File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec . describe Hotsheet ::HomeController do
6
+ describe "#error" do
7
+ it "shows an error page" do
8
+ get "/hotsheet/invalid/route"
9
+ expect ( response ) . to be_not_found
10
+ expect ( response . body ) . to include I18n . t ( "hotsheet.errors.not_found" )
11
+ end
12
+ end
13
+ end
Original file line number Diff line number Diff line change 11
11
before { prepare { config } }
12
12
13
13
describe "#index" do
14
- it "shows a table with all values" do
14
+ it "shows a spreadsheet with all values" do
15
15
get hotsheet . sheets_path :users
16
16
expect ( response ) . to be_successful
17
17
expect ( response . body ) . to include user . name
18
18
end
19
+
20
+ context "when the sheet does not exist" do
21
+ it "shows an error page" do
22
+ get "/hotsheet/authors"
23
+ expect ( response ) . to be_not_found
24
+ expect ( response . body ) . to include I18n . t ( "hotsheet.errors.not_found" )
25
+ end
26
+ end
19
27
end
20
28
21
29
describe "#update" do
65
73
end
66
74
end
67
75
end
68
-
69
- describe "#error" do
70
- it "shows an error page" do
71
- get "/hotsheet/authors"
72
- expect ( response ) . to be_not_found
73
- expect ( response . body ) . to include I18n . t ( "hotsheet.errors.not_found" )
74
- end
75
- end
76
76
end
You can’t perform that action at this time.
0 commit comments