Skip to content

Commit

Permalink
Fix tag_controller_test.rb (#9376)
Browse files Browse the repository at this point in the history
  • Loading branch information
misaka3 authored Apr 1, 2021
1 parent 04bb121 commit 6f987bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/functional/tag_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,6 @@ def setup
end

test "should show a featured wiki page at top, if it exists" do
tag = tags(:test)

get :show, params: { id: nodes(:organizers).slug }

assert_select '#wiki-summary', 1
Expand Down Expand Up @@ -606,15 +604,15 @@ def setup
end

test 'should render a text/plain when a tag is deleted through post request xhr' do
user = UserSession.create(users(:jeff))
UserSession.create(users(:jeff))
node_tag = node_tags(:awesome)
post :delete, params: { nid: node_tag.nid, tid: node_tag.tid, uid: node_tag.uid}, xhr: true
assert_equal node_tag.tid, JSON.parse(@response.body)['tid']
assert_equal true, JSON.parse(@response.body)['status']
end

test 'add_parent method adds a tag parent' do
user = UserSession.create(users(:admin))
UserSession.create(users(:admin))
get :add_parent, params: { name: Tag.last.name, parent: Tag.first.name }
assert_response :redirect
assert_equal Tag.first.name, Tag.last.parent
Expand All @@ -624,7 +622,7 @@ def setup
end

test 'add_parent method works with non-existent parent' do
user = UserSession.create(users(:admin))
UserSession.create(users(:admin))
get :add_parent, params: { name: Tag.last.name, parent: Tag.first.name }
assert_response :redirect
assert_equal Tag.first.name, Tag.last.parent
Expand Down

0 comments on commit 6f987bb

Please sign in to comment.