Skip to content

Commit ece4dda

Browse files
committed
Merge pull request #1086 from rspec/use-have-http-status-matcher-in-generators
Switch to using the `have_http_status` matcher.
2 parents 1bafa58 + 4f119d3 commit ece4dda

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
### Development
22
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.0.1...master)
33

4+
Enhancements:
5+
6+
* Switch to using the `have_http_status` matcher in spec generators. (Aaron Kromer, #1086)
7+
48
Bug Fixes:
59

610
* Suppress warning in `SetupAndTeardownAdapter`. (André Arko, #1085)

lib/generators/rspec/controller/templates/controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
describe "GET '<%= action %>'" do
88
it "returns http success" do
99
get '<%= action %>'
10-
expect(response).to be_success
10+
expect(response).to have_http_status(:success)
1111
end
1212
end
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
describe "GET /<%= table_name %>" do
55
it "works! (now write some real specs)" do
66
get <%= index_helper %>_path
7-
expect(response.status).to be(200)
7+
expect(response).to have_http_status(200)
88
end
99
end
1010
end

0 commit comments

Comments
 (0)