Merge pull request #2351 from opf/fix/minor-api-v3-spec-issues

Fix various issues with API v3 request specs
pull/2340/head
ulferts 10 years ago
commit 1e81d16bac
  1. 6
      spec/requests/api/v3/work_package_resource_spec.rb
  2. 2
      spec/requests/api/v3/work_packages/form/work_package_form_resource_spec.rb

@ -264,13 +264,15 @@ h4. things we like
end
context 'disabled' do
let(:params) { update_params.merge(notify: 'false') }
let(:patch_path) { "/api/v3/work_packages/#{work_package.id}?notify=false" }
let(:params) { update_params }
it { expect(subject).to be_empty }
end
context 'enabled' do
let(:params) { update_params.merge(notify: 'Some text here - you can take true too') }
let(:patch_path) { "/api/v3/work_packages/#{work_package.id}?notify=Something" }
let(:params) { update_params }
it { expect(subject.count).to eq(1) }
end

@ -52,7 +52,7 @@ describe 'API v3 Work package form resource', type: :request do
shared_context 'post request' do
before(:each) do
allow(User).to receive(:current).and_return current_user
post post_path, params.to_json, 'CONTENT_TYPE' => 'application/json'
post post_path, (params ? params.to_json : nil), 'CONTENT_TYPE' => 'application/json'
end
end

Loading…
Cancel
Save