diff options
author | azul <azul@leap.se> | 2014-07-21 10:36:22 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2014-07-21 10:36:22 +0200 |
commit | 791033d4a3021cc0a476a514667b17a6d519aa89 (patch) | |
tree | 650d0dff3c8f4ee77efdd237087df7c10b60cf8c /features/step_definitions/auth_steps.rb | |
parent | bbd41c9bfd2cb88a88d7436dd58a8b46a5d10cf1 (diff) | |
parent | 11d1efaef622335fe6d45917ce0b50a02e4a24a1 (diff) |
Merge pull request #181 from azul/feature/allow_anonymous_config_access
Allow fetching configs if anonymous EIP access is allowed
Diffstat (limited to 'features/step_definitions/auth_steps.rb')
-rw-r--r-- | features/step_definitions/auth_steps.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/features/step_definitions/auth_steps.rb b/features/step_definitions/auth_steps.rb index 00d9004..e75455a 100644 --- a/features/step_definitions/auth_steps.rb +++ b/features/step_definitions/auth_steps.rb @@ -1,6 +1,21 @@ - Given /^I authenticated$/ do @user = FactoryGirl.create(:user) @my_auth_token = Token.create user_id: @user.id end +Given /^I am not logged in$/ do + @my_auth_token = nil +end + +When /^I send requests to these endpoints:$/ do |endpoints| + @endpoints = endpoints.rows_hash +end + +Then /^they should require authentication$/ do + @endpoints.each do |type, path| + opts = {method: type.downcase.to_sym} + request path, opts + assert_equal 401, last_response.status, + "Expected #{type} #{path} to require authentication." + end +end |