1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
require 'spec_helper'
describe JIRA::Resource::Component do
with_each_client do |site_url, client|
let(:client) { client }
let(:site_url) { site_url }
let(:key) { '10000' }
let(:expected_attributes) do
{
'self' => 'http://localhost:2990/jira/rest/api/2/component/10000',
'id' => key,
'name' => 'Cheesecake'
}
end
let(:attributes_for_post) do
{ 'name' => 'Test component', 'project' => 'SAMPLEPROJECT' }
end
let(:expected_attributes_from_post) do
{ 'id' => '10001', 'name' => 'Test component' }
end
let(:attributes_for_put) do
{ 'name' => 'Jammy', 'project' => 'SAMPLEPROJECT' }
end
let(:expected_attributes_from_put) do
{ 'id' => '10000', 'name' => 'Jammy' }
end
it_should_behave_like 'a resource'
it_should_behave_like 'a resource with a singular GET endpoint'
it_should_behave_like 'a resource with a DELETE endpoint'
it_should_behave_like 'a resource with a POST endpoint'
it_should_behave_like 'a resource with a PUT endpoint'
it_should_behave_like 'a resource with a PUT endpoint that rejects invalid fields'
end
end
|