Commit 1ac99bcd5cb0e7284ad219d6e319b44f390f6f74
1 parent
797a99c3
Exists in
master
and in
1 other branch
add test for GET on api route
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
spec/requests/notices_controller_spec.rb
| ... | ... | @@ -45,6 +45,19 @@ describe "Notices management" do |
| 45 | 45 | |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | + # the JS notifier allows for both GET and POST requests | |
| 49 | + context "with GET request" do | |
| 50 | + let(:xml) { Rails.root.join('spec','fixtures','hoptoad_test_notice.xml').read } | |
| 51 | + it 'save a new notice' do | |
| 52 | + expect { | |
| 53 | + get '/notifier_api/v2/notices', :data => xml | |
| 54 | + expect(response).to be_success | |
| 55 | + }.to change { | |
| 56 | + errbit_app.problems.count | |
| 57 | + }.by(1) | |
| 58 | + end | |
| 59 | + end | |
| 60 | + | |
| 48 | 61 | end |
| 49 | 62 | |
| 50 | 63 | end | ... | ... |