Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faraday #58

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source "http://rubygems.org"

# Specify your gem's dependencies in ruby_odata.gemspec
gemspec

gem 'faraday_middleware', github: 'lostisland/faraday_middleware'
26 changes: 13 additions & 13 deletions features/basic_auth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Background:
Given a HTTP BasicAuth ODataService exists using username "admin" and password "passwd"
And blueprints exist for the service

Scenario: Service should respond to valid collections
Then I should be able to call "Products" on the service
Scenario: Service should respond to valid collections
Then I should be able to call "Products" on the service

Scenario: Entity should fill values on protected resource
Given I call "AddToCategories" on the service with a new "Category" object with Name: "Auth Test Category"
And I save changes
And I call "Categories" on the service with args: "1"
When I run the query within a cassette named "basic_auth_protected_resource"
Then the method "Id" on the first result should equal: "1"
And the method "Name" on the first result should equal: "Auth Test Category"
Scenario: Entity should fill values on protected resource
Given I call "AddToCategories" on the service with a new "Category" object with Name: "Auth Test Category"
And I save changes
And I call "Categories" on the service with args: "1"
When I run the query within a cassette named "basic_auth_protected_resource"
Then the method "Id" on the first result should equal: "1"
And the method "Name" on the first result should equal: "Auth Test Category"

Scenario: Should get 401 if invalid credentials provided to protected URL
Given a HTTP BasicAuth ODataService exists using username "admin" and password "bad_pwd" it should throw an exception with message "401 Unauthorized"
Scenario: Should get 401 if invalid credentials provided to protected URL
Given a HTTP BasicAuth ODataService exists using username "admin" and password "bad_pwd" it should throw an exception with message "the server responded with status 401"

Scenario: Should get 401 if no credentials provided to protected URL
Given a HTTP BasicAuth ODataService exists it should throw an exception with message "401 Unauthorized"
Scenario: Should get 401 if no credentials provided to protected URL
Given a HTTP BasicAuth ODataService exists it should throw an exception with message "the server responded with status 401"
42 changes: 22 additions & 20 deletions features/cassettes/basic_auth_protected_resource.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions features/cassettes/batch_request_additions.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions features/cassettes/batch_request_deletes.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading