Displaying 15 results from an estimated 15 matches for "should_hav".
Did you mean:
should_have
2007 Mar 01
2
error_on is deprecated?
The docs say
DEPRECATED. See Spec::Rails::Expectations
model.should_have(:no).errors_on(:attribute)
model.should_have(1).error_on(:attribute)
model.should_have(3).errors_on(:attribute)
However the rdoc for Spec::Rails::Expectations shows the same code.
The only difference is that it''s "model.should
have(1).error_on(:attribute) instead"
So is error_...
2007 May 09
4
UI testing framework? (w/o selenium)
...My company is totally cool with contributing to
open source projects if it makes sense.
Any thoughts or suggestions? Here is a sketch of what I think I''d like:
server "http://localhost:8080" do
test ''/'' do
page.status.should_be "200"
page.should_have :image, "logo.gif"
page.should_have :string, "Copyright 2006-Present SomeCo, Inc. All
rights reserved."
page.should_have :div, :id => ''copyright''
page.should_include :css, ''default.css''
page.should_have.no_broken_links...
2007 Jan 16
2
Specifying the contents of a date selector
...b question (can you tell I don''t normally write view code
yet???)...
I''m using the date_select form helper to give me three select popups,
(day, month, year). I want to specify that these exist and are set
to today''s date
I''ve tried this:
response.should_have ''form > p > select
[name="gap_quick_quote_parameters[purchase_date(3i)]"] > option'',
:attributes => { :value => ''16'', :selected
=> ''selected'' },
:content =>...
2007 Feb 26
0
Specifying Ajax hyperlinks
...consider it useful so I thought I''d ask here. I''m not
sure what the feeling on specifying links is - it strikes me as
something that needs doing because it''s generated code at the end of
the day.
I''ve got a few lines now along the lines of:
response.should_have ".moo #quack > a[href=''#''][onclick^=''new
Ajax.Updater(''][onclick*=''/product_info/rti'']"
part of the problem is that the CSS selector parser for should_have
barfs on an embedded quote. ie, even this selector doesn''t w...
2007 Feb 15
1
Specs for RJS HTML output NOT containing an element
...k with RJS, and there''s no should_not_have from assert
select.
What I''ve just cobbled together is this addition to my spec_helper.rb:
module Spec
module Rails
class AssertSelectWrapper
def should_not_have(*opts)
begin
should_have(*opts)
rescue Spec::Expectations::ExpectationNotMetError
else
fail_with("Expected no matching elements but at least
one was detected.")
end
end
end
end
end
module ActionController
class T...
2007 Jan 18
0
Best way to specify an HTML element inside another
Hi
I know should_have is preliminary but I can''t resist using it...
I have a form that contains a date select (Rails-generated). I want
to specify that the default value for each popup menu is correct
The best I can manage is this:
response.should_have "form > p > select[name=''quo...
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in
rspec_on_rails, and quickly realized that my fixtures were remaining
loaded, even in contexts that didn''t use them. Bug or feature?
Jay Levitt
2007 Sep 05
3
Rspec Caveman questions.
...s"? I can load up my test environment, but
can I spec things "live" so that I can find out what works and what doesn''t?
I find I''m wasting a chunk of time (as I don''t have the DSL even 60% down)
writing specs and getting it wrong. Am I missing a trick, or I.should_have
dsl_down_before_trying.else_return(crying)?
um, thanks for any potential caveman responses - the more caveman
(pragmatic) the better.
sudara
--
View this message in context: http://www.nabble.com/Rspec-Caveman-questions.-tf4387721.html#a12509678
Sent from the rspec-users mailing list archive a...
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 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_hav...
2007 Sep 05
6
Caveman Questions
...s"? I can load up my test environment, but
can I spec things "live" so that I can find out what works and what doesn''t?
I find I''m wasting a chunk of time (as I don''t have the DSL even 60% down)
writing specs and getting it wrong. Am I missing a trick, or I.should_have
dsl_down_before_trying.else_return(crying)?
um, thanks for any potential caveman responses - the more caveman
(pragmatic) the better.
sudara
--
View this message in context: http://www.nabble.com/Caveman-Questions-tf4384357.html#a12498949
Sent from the rspec-users mailing list archive at Nabb...
2007 Feb 13
1
RJS specs
...partial and test like this:
context "A rendered gap/product_info" do
specify "should have RJS to update the product_info div" do
assigns[:product_partial] = "product_info_rti"
render ''gap/product_info''
response.should_have_rjs :replace_html, ''product_info''
end
%w[ rti finance ].each do |product_type|
specify "should have a product_info_#{product_type} div when
the " do
assigns[:product_partial] = "product_info_#{product_type}"
rend...
2006 Dec 13
3
Testing has_many :through
I''m working with a has_many :through association, where a Member
has_many Projects through ProjectViewers. The problem I''m running
into is that Rails doesn''t load the association so line (3) fails
until I explicitly access a member of the collection (in this case, I
iterated it). Is there a better way?
Thanks,
Steve
1. assigns[:member].should_not_be_nil
2.
2007 Apr 04
11
ANN: RSpec 0.9.0 beta-1 available for download.
We''d like to get some feedback on RSpec 0.9 before we start pushing
out releases via Rubyforge''s gem server and update the website. We
have therefore made the first beta of 0.9 available - both prepackaged
and tagged in subversion (see below).
RSpec 0.9 introduces a new API for expectations, which essentially
means that your underscores go away (there has been other discussions
2007 Jul 26
5
Coding standards and whitespace
...be.tmSnippet
RSpec.tmbundle/Snippets/should_be_a_kind_of.tmSnippet
RSpec.tmbundle/Snippets/should_be_an_instance_of.tmSnippet
RSpec.tmbundle/Snippets/should_be_close.tmSnippet
RSpec.tmbundle/Snippets/should_be_redirect.tmSnippet
RSpec.tmbundle/Snippets/should_equal.tmSnippet
RSpec.tmbundle/Snippets/should_have.tmSnippet
RSpec.tmbundle/Snippets/should_have_at_least.tmSnippet
RSpec.tmbundle/Snippets/should_have_at_most.tmSnippet
RSpec.tmbundle/Snippets/should_have_records.tmSnippet
RSpec.tmbundle/Snippets/should_include.tmSnippet
RSpec.tmbundle/Snippets/should_match.tmSnippet
RSpec.tmbundle/Snippets/shoul...