test/integration/config_test.rb in quo_vadis-1.0.4 vs test/integration/config_test.rb in quo_vadis-1.0.5
- old
+ new
@@ -4,15 +4,10 @@
setup do
user_factory 'Bob', 'bob', 'secret'
end
- teardown do
- Capybara.reset_sessions!
- reset_quo_vadis_configuration
- end
-
test 'signed_in_url config' do
sign_in_as 'bob', 'secret'
assert_equal root_path, current_path
visit sign_out_path
@@ -47,9 +42,23 @@
visit new_article_path
assert_equal sign_in_path, current_path
sign_in_as 'bob', 'secret'
assert_equal root_path, current_path
+ end
+
+ test 'blocked config' do
+ QuoVadis.blocked = Proc.new do |controller|
+ controller.params[:username] == 'bob'
+ end
+ sign_in_as 'bob', 'secret'
+ within '.flash' do
+ assert page.has_content?('Sorry, your account is blocked.')
+ end
+ sign_in_as 'jim', 'secret'
+ within '.flash' do
+ assert page.has_no_content?('Sorry, your account is blocked.')
+ end
end
test 'signed_out_url config' do
visit sign_out_path
assert_equal root_path, current_path