spec/unit/trello_wrapper_spec.rb in trollolo-0.0.11 vs spec/unit/trello_wrapper_spec.rb in trollolo-0.0.12
- old
+ new
@@ -79,15 +79,15 @@
"id": "123"
}
EOT
stub_request(:get, "https://api.trello.com/1/cards/123?key=mykey&token=mytoken").
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
to_return(:status => 200, :body => card_body, :headers => {})
stub_request(:post, "https://api.trello.com/1/cards/123/attachments?key=mykey&token=mytoken").
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'188', 'Content-Type'=>'multipart/form-data; boundary=470924', 'User-Agent'=>'Ruby'}).
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'Content-Length' => '188', 'Content-Type' => 'multipart/form-data; boundary=470924', 'User-Agent' => 'Ruby'}).
to_return(:status => 200, :body => "", :headers => {})
path = given_file("attachment-data")
subject.add_attachment("123", path)
@@ -113,13 +113,13 @@
EOF
}
before(:each) do
stub_request(:get, "https://api.trello.com/1/cards/#{card_id}/attachments?fields=name&key=mykey&token=mytoken").
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
to_return(:status => 200, :body => card_attachments_body, :headers => {})
stub_request(:put, "https://api.trello.com/1/cards/#{card_id}/idAttachmentCover?key=mykey&token=mytoken&value=#{image_id}").
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'0', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'})
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'Content-Length' => '0', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'})
end
it "make the attachment with the file name passed.jpg the cover" do
subject.make_cover(card_id, image_name)
expect(WebMock).to have_requested(:put, "https://api.trello.com/1/cards/#{card_id}/idAttachmentCover?key=mykey&token=mytoken&value=#{image_id}")