mirror of
https://github.com/zhigang1992/tsemple.git
synced 2026-04-30 13:42:21 +08:00
no_locked_required filter
This commit is contained in:
@@ -56,4 +56,15 @@ class TopicsControllerTest < ActionController::TestCase
|
||||
assert_equal 'change', topic.body
|
||||
assert_redirected_to topic
|
||||
end
|
||||
|
||||
test "should not create topic for locked user" do
|
||||
user = create(:user)
|
||||
user.lock
|
||||
login_as user
|
||||
assert_no_difference "Topic.count" do
|
||||
assert_raise(ApplicationController::AccessDenied) do
|
||||
post :create, topic: attributes_for(:topic)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user