spec/baruwa_domains_spec.rb in baruwa-0.0.3 vs spec/baruwa_domains_spec.rb in baruwa-0.0.4

- old
+ new

@@ -31,11 +31,10 @@ it 'should get domains' do stub_request(:get, "https://testbaruwa.com/api/v1/domains"). with(:body => false, :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.get_domains() expect(WebMock).to have_requested(:get, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains") @@ -44,11 +43,10 @@ it 'should get a domain' do domainid = 10 stub_request(:get, "https://testbaruwa.com/api/v1/domains/#{domainid}"). with(:body => false, :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.get_domain(domainid) expect(WebMock).to have_requested(:get, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains/#{domainid}") @@ -57,11 +55,10 @@ it 'should get a domain by name' do domain_name = 'example.net' stub_request(:get, "https://testbaruwa.com/api/v1/domains/byname/#{domain_name}"). with(:body => false, :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.get_domain_by_name(domain_name) expect(WebMock).to have_requested(:get, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains/byname/#{domain_name}") @@ -69,11 +66,10 @@ it 'should create a domain' do stub_request(:post, "https://testbaruwa.com/api/v1/domains"). with(:body => @baruwapi.get_params(dom), :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.create_domain(dom) expect(WebMock).to have_requested(:post, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains") @@ -82,11 +78,10 @@ it 'should update a domain' do domainid = 10 stub_request(:put, "https://testbaruwa.com/api/v1/domains/#{domainid}"). with(:body => @baruwapi.get_params(dom), :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.update_domain(domainid, dom) expect(WebMock).to have_requested(:put, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains/#{domainid}") @@ -95,10 +90,9 @@ it 'should delete a domain' do domainid = 10 stub_request(:delete, "https://testbaruwa.com/api/v1/domains/#{domainid}"). with(:body => false, :headers => {'Accept'=>'*/*', - 'Content-Type'=>'application/json', 'User-Agent'=>'BaruwaAPI-Ruby', 'Authorization'=>'Bearer 6e2347bc-278e-42f6-a84b-fa1766140cbd'}). to_return(:status => 200, :body => "", :headers => {}) @baruwapi.delete_domain(domainid) expect(WebMock).to have_requested(:delete, "#{@baruwapi.instance_variable_get(:@baruwa_url)}/domains/#{domainid}")