summaryrefslogtreecommitdiff
path: root/users/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-22 16:22:49 +0100
committerAzul <azul@leap.se>2012-11-22 16:22:49 +0100
commitfb791b200ee4da1b6a2f4e3121cb26196e28c953 (patch)
treed71fa9065faec5f1bb584e18e45583b393bcd429 /users/test/functional
parent13f53593551549d8e95e382fd42a92efc170943d (diff)
parentec87ccfa185a4c063386d385de7af15f993b77d8 (diff)
Merge branch 'feature/error-messages-on-login' into develop
Diffstat (limited to 'users/test/functional')
-rw-r--r--users/test/functional/sessions_controller_test.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/users/test/functional/sessions_controller_test.rb b/users/test/functional/sessions_controller_test.rb
index 8f2d95c..93cc032 100644
--- a/users/test/functional/sessions_controller_test.rb
+++ b/users/test/functional/sessions_controller_test.rb
@@ -26,11 +26,12 @@ class SessionsControllerTest < ActionController::TestCase
end
test "renders warden errors" do
- strategy = stub :message => "Warden auth did not work"
- request.env['warden'].expects(:winning_strategy).returns(strategy)
+ strategy = stub :message => {:field => :translate_me}
+ request.env['warden'].stubs(:winning_strategy).returns(strategy)
+ I18n.expects(:t).with(:translate_me).at_least_once.returns("translation stub")
get :new, :format => :json
- assert_response :success
- assert_json_response :errors => strategy.message
+ assert_response 422
+ assert_json_response :errors => {"field" => "translation stub"}
end
# Warden takes care of parsing the params and