<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
[Rails plugin 1.0.5]<br><br><br></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
Hi,<br>I am looking for some guidance.<br></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">
When working on a partial which looks like this<br><br> <div class="bug" style="width: 100%;" /><br><br>I have some examples which should fail - I think - but do not:<br><br> it ' should fail' do
<br> response.should have_tag( 'div.bug', :content => 'There is no content!' )<br> end<br> <br> it ' should fail since there is no bug attribute with a value of "here"' do
<br> response.should have_tag( 'div', :attributes => {:bug => "here"} )<br> response.should have_tag( 'div', :attributes => {:bug => "here", :another_bug => 'there'} )
<br> end<br><br>I am calling render :partial => '/bug/div' in the before :each block.<br><br>As I said I would expect this to fail but it does not.<br><br>I am trying this because in the<br><br> <my_app>/vendor/plugins/rspec_on_rails/spec/rails/dsl/view_spec_spec.rb
<br><br>file there is an example<br><br> describe "A view that includes a partial using :collection and :spacer_template", :behaviour_type => :view do<br><br> before(:each) do<br> render "view_spec/partial_collection_including_template"
<br> end<br> <br> it "should render the partial w/ spacer_tamplate" do<br> response.should have_tag('div', :content => 'Alice')<br> response.should have_tag('hr', :attributes =>{:id => "spacer"})
<br> response.should have_tag('div', :content => 'Bob')<br> end<br><br> end<br><br>which does just this.<br><br>Can anyone help please ?<br><br>Cheers!<br>sinclair<br><br></span>