Skip to content

Commit f8aaf75

Browse files
committed
Generate show and edit specs
1 parent e79a219 commit f8aaf75

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/generators/rspec/scaffold/templates/request_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,29 @@
3737
end
3838
<% end -%>
3939
40+
describe "GET /show" do
41+
it "renders a successful response" do
42+
<%= file_name %> = <%= class_name %>.create! valid_attributes
43+
get <%= "#{singular_table_name}_url(#{file_name})" %>
44+
expect(response).to be_successful
45+
end
46+
end
47+
4048
describe "GET /new" do
4149
it "renders a successful response" do
4250
get <%= "#{new_helper}" %>
4351
expect(response).to be_successful
4452
end
4553
end
4654
55+
describe "GET /edit" do
56+
it "render a successful response" do
57+
<%= file_name %> = <%= class_name %>.create! valid_attributes
58+
get <%= "edit_#{singular_table_name}_url(#{file_name})" %>
59+
expect(response).to be_successful
60+
end
61+
end
62+
4763
describe "POST /create" do
4864
context "with valid parameters" do
4965
it "creates a new <%= class_name %>" do

0 commit comments

Comments
 (0)