Displaying 13 results from an estimated 13 matches for "should_have_tag".
2006 Oct 04
1
String.should_hav_tag
I''ve just upgraded to rspec 0.6.4 and several specs were broken. All
for the same reason. String.should_have_tag doesn''t seem to be
supported any longer.
It used to be possible to write assertions like:
response.body.should_have_tag :tag => "form"
or
"<html><body/></html>".should_have_tag :tag => "body"
But these fail with 0.6.4. The documen...
2006 Oct 07
0
should_have_tag: What am I doing wrong?
My spec contains:
response.should_have_tag "<legend>", :content => "Add new Contact"
The output is:
Spec::Expectations::ExpectationNotMetError in ''The ResourceController
should do something when I try to edit contacts''
..
<legend>Add new Contact</legend>
..
should include [[{:c...
2007 Jan 16
2
Links in view specs
...;%= link_to "Get a GAP quote", :action => "get_quote" %>
And this spec:
context "A rendered gap/index" do
setup do
render ''gap/index''
end
specify "should have a link to the get_quote page" do
response.should_have_tag ''a'', :attributes => { :href => /\/gap
\/get_quote/ }
end
end
But is fails because it actually links like this:
<a href="/view_spec/get_quote">
not
<a href="/gap/get_quote">
What''s the cleanest way to test links witho...
2007 Feb 12
6
Specs for Ajax partials with unicode characters
..._FILE__) + ''/../../spec_helper''
context "Given a request to render view_test/test_action" do
setup do
render ''view_test/test_action''
end
specify "the response should have a p with ?500" do
response.should_have_tag ''p'', :content => ''?500''
end
specify "the response should definitely have a p with ?500" do
response.should_have ''p'', :text => ''?500''
end
end
The error for the should_have_tag...
2006 Nov 07
3
include Helper in context?
...#39;'ll file a bug!
Many thanks,
Jerry
context "account/login (view)" do
include StandardHelpers
specify ''displays title "Login"'' do
self.methods.should_include ''title''
render ''account/login''
response.should_have_tag ''h1'', :content => ''Login''
end
end
# fails with:
ActionView::TemplateError in ''account/login (view) displays title "Login"''
undefined method `title'' for #<#<Class:0xb73154ac>:0xb7314f70>
On line #1 of app/views...
2007 Apr 11
13
View Specs Fail with "protected method render"
...Helper
setup do
@errors = mock("errors")
@errors.stub!(:count).and_return(0)
@user = mock_user
@user.stub!(:errors).and_return @errors
assigns[:user] = @user
end
specify "should render new form" do
render "/users/new.rhtml"
response.should_have_tag ''form'', :attributes =>{:action => users_path,
:method => ''post''}
end
end
Can anyone think of why "render" is protected? Is this a versioning issue?
Thanks - Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
U...
2006 Nov 10
3
Specifying views
...Here''s my spec in specs/views/accounts/
new_view_spec.rb:
require File.dirname(__FILE__) + ''/../../spec_helper''
context "The new account form" do
specify "should have an account name" do
render ''accounts/new''
response.should_have_tag ''input'', :attributes => {:name =>
''account[name]'', :type => ''text''}
end
end
and when I run that, I get:
1)
RuntimeError in ''The new account form should have an account name''
Deprecating @session, but it''...
2007 May 26
11
RSpec
Hi RSpec Mailing list,
I''m new to RSpec and I am trying to get it running with the caboo.se sample
rails app.
I installed the current version of rspec with rspec_on_rails
I tried to run rake spec but received:
330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec
(in /Users/multimedia/Desktop/restful_auth_rspec)
2006 Dec 13
4
RSpec and simply_helpful
...shift")
@shift.stub!(:class).and_return(Shift)
@shift.stub!(:id).and_return(1)
assigns[:shifts] = [@shift]
end
specify "should have a div tag for the shift" do
render ''shifts/index'', :helper => ''simply_helpful''
response.should_have_tag ''div'', :attributes => { :id => ''shift_1'' }
end
end
My template just makes a call like this:
<%= render :partial => @shifts %>
I''ve done some experimentation, and it seems that RSpec''s
implementation of ''render_partia...
2006 Dec 20
8
RSpec 0.7.5
The RSpec Development Team is pleased to announce the release of RSpec 0.7.5.
This release adds support for Heckle - Seattle''rb''s code mutation tool.
There are also several bug fixes to the RSpec core and the RSpec on
Rails plugin.
Changes: http://rspec.rubyforge.org/changes.html
Download: http://rubyforge.org/frs/?group_id=797
or
gem install rspec
Happy spec''ing,
2007 Feb 26
0
Specifying Ajax hyperlinks
...hould_have_link_to_remote ".moo #quack >", :url => "/
product_info/rti", :update => "blah"
or something along those lines.
Anyone else consider this a good idea? I get the feeling I''m alone
almost in using should_have (we''ve only got one should_have_tag left
I think, to specify an attribute must be missing).
Ashley
2006 Nov 16
0
helpers not rendered in views?
...rl => {:action
=> :something } %>
<textarea style="width: 100%" rows="2">Enter text here.</textarea>
<% end_form_tag %>
</div>
failing spec:
specify "Form is rendered" do
render "/controller/_xyz"
response.should_have_tag ''form'', :parent => { :tag => "div" }
end
Micah Martin
8th Light, Inc.
www.8thlight.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20061116/9c1ff95b/attachment.html
2006 Dec 30
2
Another RSpec on Rails issue: how to test send_file()
Hi!
Today I needed to implement some controller code, that uses send_file()
to send image data. How can this be tested / specified with RSpec?
bye,
Tobias