|
|
|
@ -448,9 +448,13 @@ h4. things we like |
|
|
|
|
context 'invalid status' do |
|
|
|
|
include_context 'patch request' |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
'Status ' + I18n.t('activerecord.errors.models.' \ |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
'Status ' + I18n.t('activerecord.errors.models.' \ |
|
|
|
|
'work_package.attributes.status_id.status_transition_invalid') |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'wrong resource' do |
|
|
|
@ -458,11 +462,14 @@ h4. things we like |
|
|
|
|
|
|
|
|
|
include_context 'patch request' |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
I18n.t('api_v3.errors.invalid_resource', |
|
|
|
|
property: 'Status', |
|
|
|
|
expected: 'Status', |
|
|
|
|
actual: 'User') |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
I18n.t('api_v3.errors.invalid_resource', |
|
|
|
|
property: 'Status', |
|
|
|
|
expected: 'Status', |
|
|
|
|
actual: 'User') |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -553,20 +560,25 @@ h4. things we like |
|
|
|
|
context 'user doesn\'t exist' do |
|
|
|
|
let(:user_href) { '/api/v3/users/909090' } |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
I18n.t('api_v3.errors.validation.' \ |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
I18n.t('api_v3.errors.validation.' \ |
|
|
|
|
'invalid_user_assigned_to_work_package', |
|
|
|
|
property: property.capitalize) |
|
|
|
|
property: property.capitalize) |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'user is not visible' do |
|
|
|
|
let(:invalid_user) { FactoryGirl.create(:user) } |
|
|
|
|
let(:user_href) { "/api/v3/users/#{invalid_user.id}" } |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
I18n.t('api_v3.errors.validation.' \ |
|
|
|
|
'invalid_user_assigned_to_work_package', |
|
|
|
|
property: property.capitalize) |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
I18n.t('api_v3.errors.validation.invalid_user_assigned_to_work_package', |
|
|
|
|
property: property.capitalize) |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'wrong resource' do |
|
|
|
@ -574,11 +586,14 @@ h4. things we like |
|
|
|
|
|
|
|
|
|
include_context 'patch request' |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
I18n.t('api_v3.errors.invalid_resource', |
|
|
|
|
property: "#{property.capitalize}", |
|
|
|
|
expected: 'User', |
|
|
|
|
actual: 'Status') |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
I18n.t('api_v3.errors.invalid_resource', |
|
|
|
|
property: "#{property.capitalize}", |
|
|
|
|
expected: 'User', |
|
|
|
|
actual: 'Status') |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'group assignement disabled' do |
|
|
|
@ -587,10 +602,12 @@ h4. things we like |
|
|
|
|
include_context 'setup group membership', false |
|
|
|
|
include_context 'patch request' |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', |
|
|
|
|
I18n.t('api_v3.errors.validation.' \ |
|
|
|
|
'invalid_user_assigned_to_work_package', |
|
|
|
|
property: "#{property.capitalize}") |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { |
|
|
|
|
I18n.t('api_v3.errors.validation.invalid_user_assigned_to_work_package', |
|
|
|
|
property: "#{property.capitalize}") |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -741,7 +758,9 @@ h4. things we like |
|
|
|
|
|
|
|
|
|
include_context 'patch request' |
|
|
|
|
|
|
|
|
|
it_behaves_like 'constraint violation', "Subject can't be blank" |
|
|
|
|
it_behaves_like 'constraint violation' do |
|
|
|
|
let(:message) { "Subject can't be blank" } |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'multiple invalid attributes' do |
|
|
|
|