Commit 6c5e20c1 authored by Mike Greiling's avatar Mike Greiling

update all status_code calls to use new inspect_requests helper

parent b5c211ba
...@@ -2,6 +2,7 @@ require 'rails_helper' ...@@ -2,6 +2,7 @@ require 'rails_helper'
feature 'User creates snippet', :js do feature 'User creates snippet', :js do
include DropzoneHelper include DropzoneHelper
include InspectRequests
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -43,8 +44,8 @@ feature 'User creates snippet', :js do ...@@ -43,8 +44,8 @@ feature 'User creates snippet', :js do
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/uploads/-/system/temp/\h{32}/banana_sample\.gif\z}) expect(link).to match(%r{/uploads/-/system/temp/\h{32}/banana_sample\.gif\z})
visit(link) reqs = inspect_requests { visit(link) }
expect(page.status_code).to eq(200) expect(reqs.first.status_code).to eq(200)
end end
end end
...@@ -61,8 +62,8 @@ feature 'User creates snippet', :js do ...@@ -61,8 +62,8 @@ feature 'User creates snippet', :js do
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/uploads/-/system/personal_snippet/#{Snippet.last.id}/\h{32}/banana_sample\.gif\z}) expect(link).to match(%r{/uploads/-/system/personal_snippet/#{Snippet.last.id}/\h{32}/banana_sample\.gif\z})
visit(link) reqs = inspect_requests { visit(link) }
expect(page.status_code).to eq(200) expect(reqs.first.status_code).to eq(200)
end end
scenario 'validation fails for the first time' do scenario 'validation fails for the first time' do
...@@ -86,8 +87,8 @@ feature 'User creates snippet', :js do ...@@ -86,8 +87,8 @@ feature 'User creates snippet', :js do
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/uploads/-/system/personal_snippet/#{Snippet.last.id}/\h{32}/banana_sample\.gif\z}) expect(link).to match(%r{/uploads/-/system/personal_snippet/#{Snippet.last.id}/\h{32}/banana_sample\.gif\z})
visit(link) reqs = inspect_requests { visit(link) }
expect(page.status_code).to eq(200) expect(reqs.first.status_code).to eq(200)
end end
scenario 'Authenticated user creates a snippet with + in filename' do scenario 'Authenticated user creates a snippet with + in filename' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment