Displaying 20 results from an estimated 8000 matches similar to: "be_success misleading"
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
2007 May 10
5
Shared behavior and_raise problem, and site aestetics
Hello,
Is anyone else having trouble with the and_raise method on mocks,
with respect to shared behaviors? If I do the following instead:
foo.should_receive(:bar).and_return { raise }
everything seems to work. I have been supplying no arguments to
and_raise, by the way.
Also, you may want to make the background in the code examples on the
home page a little lighter. I am hardly able to
2007 Jun 18
7
Testing for cross site scripting, etc.
Being new to testing and ruby, are there "standard" tests that can be
done that test for things like cross site scripting and friends?
If not, anyone have ideas on what I might do about testing those sorts
of things?
I''ll be using rails, also.
Mike B.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging
2007 Jun 29
12
testing instance variables that are set inside views
Hi all,
In my view specs (for Rails), how can I get at instance variables that
are set within my view? For example, if my view looks like this:
<% @header = "My Header" -%>
<div>some content</div>
How can I get to @header from within my view spec? I''ve tried @header
and assigns[:header] to no avail.
TIA,
Jeremy
--
Jeremy Stephens Computer Systems
2007 May 04
2
Custom Matcher and NAME NOT GENERATED annoyance
Hello RSpec users,
Have been using RSpec since 0.8.2 (not too long ago, I must say). and
been creating my custom matchers since was defined as "good practice".
Also, auto-generated names for the examples is very helpful, I''m
trying to take advantage of it.
Since I often prior code/define all the "examples", I have created a
few matchers to fulfill associations and
2007 Mar 28
3
respond.should be_successful
I''m wondering: Does it make more sense to add on successful? as an
alias for success? in ActionController:TestRequest?
I keep getting these two mixed up in my specs and was wondering if it
would be helpful to anyone as a small patch to rspec.
Best,
Scott
2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello,
I have a controller action that raises a RecordNotFound exception if
you''re not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
template. But when I run cucumber (using webrat), it''s getting the
full stacktrace (the step blows up). Any ideas why? I have
consider_all_requests_local turned off in my test.rb.
2008 Sep 09
12
cucumber - mark a step as pending
I love the way I can throw a call to pending() in the top of an
unfinished RSpec example and stop it from failing the build.
Is there a similar way to do such a thing with good ole'' cucumber?
cheers,
Matt
----
http://blog.mattwynne.net
http://songkick.com
In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former,
2009 Mar 19
6
[Cucumber 0.2] Failure to use should
I have a step definition like this:
Then "the account should be created" do
account = Account.find_by_name("my shiny new account")
p account.class
account.should_not be_blank
end
When running this step, I got the error message:
Account(id: integer, name: string, state: string, next_renewal_at: date,
created_at: datetime, updated_at: datetime, full_domain: string,
2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running
the following:
should_render(:index)
should_be_valid
should_not_be_valid
should_respond_to
should_be
should_render
I thought the syntax changed to something like the following:
obj.should render(:index)
but this doesn''t seem to work.
Scott
2007 Dec 17
14
Change in isolation behaviour 1.08 - 1.10 ?
Hi,
I just moved from 1.08 to 1.10 and now have one example failing, which,
under 1.08, passed. Is the due to a change in behaviour?
Here''s my spec (removed some passing examples)
require File.dirname(__FILE__) + ''/../spec_helper''
describe "A user" do
before(:each) do
@user = User.new
@valid_user = User.new(
:email =>
2007 Jun 02
7
I''m really bad at controllers, help please.
Hey,
Sorry for so many questions - I''m really bad at this right now.
I''m trying to cover the following code w/ rspec
def index
if params[:user_id]
@user = User.find(params[:user_id])
@messages = @user.messages
end
end
So basically what I''m doing is listing all the messages for a user,
provided there is an id parameter.
describe
2007 May 31
28
Another attempt for a succinct model validation DSL
On 5/28/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> The behaviour you''re trying to describe is that the User should
> require that passwords bear certain qualities - in this case a length
> between 5 and 40. So you need to ask yourself how the User should
> behave when this requirement is violated, and then specify that it
> behaves that way.
>
>
2007 May 19
2
have_text matcher does not support should_not.
Hello Guys,
Doing conversion of some test for some controllers, still with integrated views.
Anyway, I have this:
it "should not see Join This Group button on profile page as member" do
get "show", :id => @group.id
response.should be_success
response.should_not have_text(/Join This Group/)
end
But running with spec (0.9.4), drop me the folling error:
2009 Jan 17
10
Cucumber Scenario Outlines Output Insufficient
I''m having problems knowing what a scenario outline I''ve created is doing.
In particular I have no idea about what steps are being matched when the
outline is run so when I break something I can''t find out what is wrong. Is
there any progress on getting better output for scenario outlines.
TIA
Andrew
-------------- next part --------------
An HTML attachment was
2007 Mar 29
21
a better "should have valid associations"
This is pretty much the same as last time around, if you recall.
Thanks to Wilson for converting to the new form. I''ve added a few
lines. Basically, it iterates over your model associations and does
two things.
- First, just try to call the association. Usually fixes speeling
erors or other such silliness.
- Second, try to find a record with an :include on the association.
This
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2007 May 03
6
RSpec 0.9.2
Behind every great release is a maintenance release.
Go get it while it''s hot.
We''ve also reworked the website a little - trying to scare off fewer people.
Aslak
2007 Mar 14
5
What''s the new syntax for predicates?
@settings.should allow_publish_ip("127.0.0.1") fails with
undefined method `allow_publish_ip'' for #<#<Class:0x2f8fd48>:0x2f5a968>
@settings.should_allow_publish_ip("127.0.0.1") works fine
This is rspec 0.8.2.
http://rspec.rubyforge.org/documentation/expectations.html says that
matching arbitrary predicates is deprecated and to see
2009 Jan 17
3
[Cucumber] Struggling with "multiple step definitions"
Hey gang,
I find myself struggling with multiple step definitions in cucumber
all the time. I regularly test the contents of my flash[:notice] in
steps, since I think that''s part of the behaviour of the app. So,
while implementing a new feature, I ran into the following error:
/opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.15/bin/../lib/cucumber/
step_mother.rb:81:in