Commit ed87c05a
Changed files (3)
spec
views
spec/views/tutorials/edit.html.erb_spec.rb
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe "tutorials/edit" do
- before(:each) do
- @tutorial = assign(:tutorial, FactoryGirl.build(:tutorial))
- end
-
- it "renders the edit tutorial form" do
- render
-
- # Run the generator again with the --webrat flag if you want to use webrat matchers
- assert_select "form", :action => tutorials_path(@tutorial), :method => "post" do
- assert_select "input#tutorial_heading", :name => "tutorial[heading]"
- assert_select "textarea#tutorial_description", :name => "tutorial[description]"
- assert_select "input#tutorial_url", :name => "tutorial[url]"
- assert_select "input#tutorial_author", :name => "tutorial[author]"
- assert_select "input#tutorial_author_url", :name => "tutorial[author_url]"
- end
- end
-end
spec/views/tutorials/index.html.erb_spec.rb
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe "tutorials/index" do
- before(:each) do
- items = []
- (1..2).each do |item|
- items << FactoryGirl.build(:tutorial,
- :heading => "Heading",
- :description => "MyText",
- :created_at => DateTime.new(2012, 9, 13)
- )
- end
- assign(:tutorials, Kaminari.paginate_array(items).page(1))
- render
- end
-
- it "should display the text for each tutorial" do
- assert_select "p", :text => "MyText".to_s, :count => 2
- end
-
- it "should display the heading for each tutorial" do
- assert_select "h3", :text => "Heading September. 13, 2012", :count => 2
- end
-end
spec/views/tutorials/show.html.erb_spec.rb
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe "tutorials/show" do
- before(:each) do
- @tutorial = assign(:tutorial, stub_model(Tutorial,
- :heading => "Heading",
- :description => "MyText",
- :url => "Url",
- :image_url => "http://placehold.it/300x200",
- :created_at => DateTime.new(2012, 9, 20)
- ))
- end
-
- it "renders attributes in <p>" do
- render
- rendered.should match(/Heading/)
- rendered.should match(/MyText/)
- rendered.should match(/Url/)
- end
-end