From 059e061b1592b583848c2056a9ca1c9fb46d98c0 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 9 Sep 2019 15:06:24 -0500 Subject: [PATCH] tests: fixup comment vote, post controller tests. Use git clean to delete stale files from an earlier checkout. These files interfered with various things (specifically, a comment vote test failed because there was an old comment_votes/create.json.erb template hanging around that changed the behavior of the POST /comment_votes endpoint). --- config/docker/danbooru-ci | 1 + test/functional/posts_controller_test.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/docker/danbooru-ci b/config/docker/danbooru-ci index b2780304c..26c64479e 100644 --- a/config/docker/danbooru-ci +++ b/config/docker/danbooru-ci @@ -25,5 +25,6 @@ RUN sed -i'' -e 's/run -it/run -i/' /usr/local/bin/circleci USER danbooru RUN git reset --hard master +RUN git clean --force RUN gem install bundler --version $BUNDLER_VERSION RUN bundle install > /dev/null diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index a54f69f13..0e660d49d 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -220,7 +220,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest context "in api responses" do should "not include restricted attributes" do - as(@user) { @post.update(tag_string: "loli") } + Post.any_instance.stubs(:visible?).returns(false) get_auth post_path(@post), @user, as: :json assert_response :success