-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dave Kiger
committed
Apr 23, 2012
1 parent
4656143
commit 046b015
Showing
6 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
class HelpController < ApplicationController | ||
skip_before_filter :authenticated?, :only => [:master_authentication] | ||
before_filter :authenticated_master?, :only => [:master_authentication] | ||
def authentication | ||
respond_with(["authorized"], :status => 200, :location => nil) | ||
end | ||
|
||
def master_authentication | ||
respond_with(["authorized"], :status => 200, :location => nil) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
resources :help, :only => [] do | ||
collection do | ||
get "authentication" | ||
get "master_authentication" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Feature: Authentication Testing | ||
The web service provides a way to test authentication. | ||
|
||
Scenario: When I post a request as JSON with valid authentication credentials, then the app will say I am authorized. | ||
Given I am authenticated | ||
Given I have master permissions | ||
When I perform a GET to "/help/master_authentication" as JSON | ||
Then the HTTP status code should be "200" | ||
And the response at index 0 of the JSON response data should be "authorized" | ||
|
||
Scenario: When I post a request as XML with valid authentication credentials, then the app will say I am authorized. | ||
Given I am authenticated | ||
Given I have master permissions | ||
When I perform a GET to "/help/master_authentication" as XML | ||
Then the HTTP status code should be "200" | ||
And the response at index 0 of the XML response data should be "authorized" | ||
|
||
Scenario: When I post a request as HTTP with valid authentication credentials, then the app will say I am authorized. | ||
Given I am authenticated | ||
Given I have master permissions | ||
When I perform a GET to "/help/master_authentication" as HTTP | ||
Then the HTTP status code should be "200" | ||
And the response at index 0 of the JSON response data should be "authorized" |