Skip to content

Commit

Permalink
add spec for flash.now in view example group
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Dec 21, 2009
1 parent 48e91f6 commit aec7630
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions spec/resources/views/view_spec/accessor.html.erb
@@ -1,5 +1,6 @@
<div id="session"><%= session[:key] %></div>
<div id="params"><%= params[:key] %></div>
<div id="flash"><%= flash[:key] %></div>
<div id="flash_now"><%= flash[:now_key] %></div>
<div id="controller"><%= params[:controller] %></div>
<div id="action"><%= params[:action] %></div>
25 changes: 11 additions & 14 deletions spec/spec/rails/example/view_example_group_spec.rb
Expand Up @@ -176,38 +176,35 @@ def render!
session[:key] = "session"
params[:key] = "params"
flash[:key] = "flash"
flash.now[:now_key] = "flash.now"
render "view_spec/accessor"
end

it "should use the template as the implicit subject" do
it "uses 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
it "has access to session data" do
response.should have_tag("div#session", "session")
end

specify "should have access to params data" do
it "has access to params data" do
response.should have_tag("div#params", "params")
end

it "should have access to flash data" do
it "has access to flash" do
response.should have_tag("div#flash", "flash")
end

it "should have a controller param" do
it "has access to flash.now" do
response.should have_tag("div#flash_now", "flash.now")
end

it "has a controller param" do
response.should have_tag("div#controller", "view_spec")
end

it "should have an action param" do
it "has an action param" do
response.should have_tag("div#action", "accessor")
end
end
Expand Down

0 comments on commit aec7630

Please sign in to comment.