Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed ViewExampleGroup to use template as the implicit subject by d…

…efault

[#686]
  • Loading branch information...
commit 382f1d4dc5bd2f2cec719cae870e4d5f4f60f48b 1 parent dd82685
Joe Ferris jferris authored committed
7 lib/spec/rails/example/view_example_group.rb
View
@@ -48,6 +48,13 @@ def forget_variables_added_to_assigns
# end
class ViewExampleGroup < FunctionalExampleGroup
tests ViewExampleGroupController
+ class << self
+ def inherited(klass) # :nodoc:
+ klass.subject { template }
+ super
+ end
+ end
+
before(:each) do
ensure_that_flash_and_session_work_properly
end
12 spec/spec/rails/example/view_example_group_spec.rb
View
@@ -177,6 +177,18 @@ def render!
render "view_spec/accessor"
end
+ it "should use the template as the implicit subject" do
+ subject.should == template
+ end
+
+ describe "with a specified subject" do
+ subject { 'specified' }
+
+ it "should use the specified subject" do
+ subject.should == 'specified'
+ end
+ end
+
it "should have access to session data" do
response.should have_tag("div#session", "session")
end
Please sign in to comment.
Something went wrong with that request. Please try again.