Created
August 8, 2012 16:05
-
-
Save petrblaho/3296229 to your computer and use it in GitHub Desktop.
saved in spec/requests/api/
This file contains hidden or 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
| require 'spec_helper' | |
| describe "ProviderAccounts" do | |
| let(:headers) { { | |
| 'HTTP_ACCEPT' => 'application/xml', | |
| 'CONTENT_TYPE' => 'application/xml' | |
| } } | |
| before(:each) do | |
| user = FactoryGirl.create(:admin_permission).user | |
| login_as(user) | |
| end | |
| describe "POST /api/providers/:provider_id/provider_accounts" do | |
| before(:each) do | |
| post "/api/providers/#{provider.id}/provider_accounts", xml, headers | |
| end | |
| context "with valid mock provider account XML" do | |
| let(:xml) { "<provider_account><label>mockaccount</label><credentials><username>mockuser</username><password>mockpassword</password></credentials></provider_account>" } | |
| let(:provider) { FactoryGirl.create(:mock_provider) } | |
| it_behaves_like "http Created" | |
| context "response" do | |
| subject { response } | |
| it { should have_content_type("application/xml") } | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment