Skip to content

Commit b5a51be

Browse files
committed
Fix specs
1 parent 76e5630 commit b5a51be

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

spec/requests/hotsheet/sheets_controller_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111
before { prepare { config } }
1212

1313
describe "#index" do
14-
it "shows a table with all values" do
14+
it "shows a spreadsheet with all values" do
1515
get hotsheet.sheets_path :users
1616
expect(response).to be_successful
1717
expect(response.body).to include user.name
1818
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
1927
end
2028

2129
describe "#update" do
@@ -65,12 +73,4 @@
6573
end
6674
end
6775
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
7676
end

0 commit comments

Comments
 (0)