http://dl.dropbox.com/u/15024055/CloudShot/shot_15032012_232654.png
if i write the test like this its working just fine it passes green
[code] it "should have the right title" do get 'view' response.should have_selector('title', :content => "View Snippets") end [/code]
but for the same page this other format is red, they shold test for the same thing?
[code] require 'spec_helper'
describe "SnippetsPages" do
describe "New Snippet pages" do before { get 'new'}
it { should have_selector('h1', content: 'New') } it { should have_selector('title', content: full_title('New Snippet')) } end
describe "View Snippets pages" do before { get 'view' }
it { should have_selector('h1', content: 'View') } it { should have_selector('title', content: full_title('View Snippets')) } end end [/code]
I can't understand why my tests is not working Here is the helper:
[code] def full_title(page_title) base_title = "Sample App" if page_title.empty? base_title else page_title end end [/code]