Skip to content

Commit ba61cd6

Browse files
committed
Adds a spec to test for Sinatra errors
Because the Sinatra error page shows a table of Variables and Values, if there is a Ruby error in the code, the specs will all pass. This commit adds adds a spec to check for 'backtrace' text that would indicate the error page.
1 parent 6a4f04e commit ba61cd6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

spec/basic_sinatra_forms_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
end
2121

2222
describe 'POST /team' do
23+
it 'does not return Sinatra error page' do
24+
visit '/newteam'
25+
26+
click_button "submit"
27+
expect(page).to_not have_text("Backtrace")
28+
end
29+
2330
it "displays the basketball team name in the browser" do
2431
visit '/newteam'
2532

@@ -84,4 +91,4 @@
8491

8592

8693
end
87-
end
94+
end

0 commit comments

Comments
 (0)