Skip to content

Commit 8e0b9fb

Browse files
committed
added pinned links test
1 parent c89cd0e commit 8e0b9fb

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/controllers/pinned_links_controller_test.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
class PinnedLinksControllerTest < ActionController::TestCase
44
include Devise::Test::ControllerHelpers
55

6+
test 'only mods or higher should be able to see pinned links' do
7+
users.each do |user|
8+
sign_in user
9+
get :index
10+
11+
assert_response(user.at_least_moderator? ? :success : :not_found)
12+
end
13+
end
14+
615
test 'only mods or higher should be able to create pinned links' do
716
post = posts(:question_one)
817

@@ -61,7 +70,7 @@ class PinnedLinksControllerTest < ActionController::TestCase
6170
assert_equal 'updated label', assigns(:link).label
6271
end
6372

64-
test 'update should correctly handle invlid pinned links' do
73+
test 'update should correctly handle invalid pinned links' do
6574
sign_in users(:moderator)
6675
try_update_pinned_link(pinned_links(:active_with_label), link: nil)
6776
assert_response(:bad_request)

0 commit comments

Comments
 (0)