Skip to content

Commit b17a13c

Browse files
committed
1st attempt at writing a spec
1 parent b2d22e4 commit b17a13c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/rspec/rails/example/controller_example_group_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ def group_for(klass)
1717

1818
let(:group) { group_for ApplicationController }
1919

20+
it "runs the 'before' hook" do
21+
ex = group.example { expect(25).to eq(5) }
22+
group.before { raise("WHOOPS") }
23+
group.run
24+
25+
expect { ex }.to raise_error("WHOOPS")
26+
end
27+
2028
it "includes routing matchers" do
2129
expect(group.included_modules).to include(RSpec::Rails::Matchers::RoutingMatchers)
2230
end

0 commit comments

Comments
 (0)