Displaying 20 results from an estimated 8000 matches similar to: "helper methods starting with should"
2007 Nov 07
1
Helper methods starting with should_ get picked up as examples?
Hi!
I recently updated my rspec and rspec_on_rails plugins to the tip of
the trunk and ran into an issue with helper methods with names
starting with should_ in my describe blocks. Fictive example to show
what I''m talking about:
describe Order do
it "Can be paid for" do
...
should_have_paid(user)
end
def should_have_paid(user)
end
end
I know in
2008 Jan 10
21
Shoulda
Hey, we''re currently using shoulda (http://dev.thoughtbot.com/
shoulda/) on a project and I saw some things that would be really nice
to see in rspec, namely the should_ methods, and especially the
should_be_restful method. Do these go against the rspec goals at
all? Or could an ambitious programmer go to town implementing these
for rspec_on_rails?
Nathan Sutton
fowlduck at
2010 Aug 11
6
rspec2 not working with shoulda
I am using rails edge. I am using gem "rspec-rails", "= 2.0.0.beta.
19" .
I have following code at spec/models/user_spec.rb
require ''spec_helper''
describe User do
it { should validate_presence_of(:email) }
it { should validate_presence_of(:name) }
end
Here is my gemfile
group :development, :test do
gem ''factory_girl_rails'',
2007 Nov 15
3
How to Run Rails Stories
I have non non-plain-text story without any steps_for, can it be run?
If so, how?
Thanks,
Nate
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 Nov 15
7
Plain Text Stories Chaining Scenarios
I''m writing a plain text story (testing the waters) and I have
scenarios that I need to chain in my specs.
Here is what I have so far:
Story: User purchasing tshirts
As a user
I want to checkout
So that I can purchase shirts
Scenario: User goes to checkout with nothing in cart
Given a user
And user has an empty cart
When user goes to checkout
Then user
2006 Oct 24
5
Radrails and RSpec
Hi all,
Does anyone know how to get radrails to use RSpec specs instead of tests?
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2007 Nov 21
22
Getting Class in Shared Behaviours
Hi,
I want to be able to get at the described class in my shared behaviour. I''m
sure an example will say it better than my words
describe "my shared", :shared => true do
it "should tell me what the class is its describing" do
how_do_i_get_the_user_class_here
end
end
describe User do
it_should_behave_like "my shared"
#...
end
So in my
2007 Nov 19
5
Stories and Pending Actions
I can''t get my plain text stories to show pending actions like the
example addition plain text story. Any tips? (See below)
http://pastie.caboo.se/119627
Nathan Sutton
fowlduck at gmail.com
rspec edge revision 2910
rspec_on_rails edge revision 2909
rails edge revision 8167
2007 Dec 11
5
RSpec TMbundle
I tried checking it out today using instructions here:
http://rspec.rubyforge.org/tools/extensions/editors/textmate.html
I get a ''svn: Connection closed unexpectedly''. Did it move or is it
down?
Nathan Sutton
fowlduck at gmail.com
rspec edge revision 3052
rspec_on_rails edge revision 3049
rails edge revision 8269
2008 Oct 18
4
Problems when programmatically defining examples
Hi,
I am trying to code an application that is based on Rspec; I am
programmatically building examples, and launching the runner with a custom
formatter. Here are the code snippets from my app:
Launching the runner:
example_groups =
test_expectation.example_groups_for(system_state)
@output = StringIO.new
options =
2007 Dec 14
13
RSpec-1.1.0 is released
The RSpec Development Team is pleased as glug (that''s kind of like
punch, but more festive) to announce RSpec-1.1.0.
Thanks to all who have contributed patches over the last few months.
Big thanks to Dan North and Brian Takita for their important work on
this release. Dan contributed his rbehave framework which is now the
Story Runner. Brian patiently did a TON of refactoring around
2007 Dec 27
5
ExampleGroup and SharedExampleGroup relationship(?)
I''m working on a series going over the source code for rspec, and I ran into
something interesting with ExampleGroup and SharedExampleGroup. I was
wondering if anyone could shed light on it.
[NOTE: I''m working through the code for my own edification in learning Ruby.
Ruby has some features that I think are incredibly cool, so I''m using a
concrete implementation (RSpec)
2007 Nov 30
4
Autotest''ing specs on non-rails app
I''m having trouble using autotest with rspec on a non-rails project.
my Rspec gem is version 1.0.8, ZenTest is 3.6.2
project structure
$ ls *
lib:
parser.rb
spec:
parser_spec.rb
autotest finds and runs the spec, but it won''t detect changes to lib/parser.rb
I know it''s something stupid, but...
help?
--
Rick DeNatale
My blog on Ruby
2007 May 30
2
should_eql etc?
Hi, I''m trying the specs for restful_authentication I found here
http://jonathan.tron.name/articles/2007/01/02/rspec-on-rails-restful-
authentication
It seems to use custom .should methods: should_eql,
should_be_an_instance_of, should_redirect_to, should_be_success,
should_not_be_nil, should_be_nil, should_not_be_nil, should_be_empty,
should_be_success, should_not_change, and
2007 Nov 20
9
Testing Models without fixtures
Hi,
I would like to test a sorting method that is in the user model, it''s
a class method called search.
What I would like to do is create 2 users and load the test database
with just those 2 users, so that I can call
User.search("john") and it would return those two users.
Not sure how to clear the test database and populate it just with
these 2 users for that specific
2007 Nov 14
5
ETA to Stories
Hey guys, just poppin in to ask if anyone knows when stories will be
somewhat stable? We''re starting to use integration tests at work,
we''re already using rspec, and I''d like to avoid integration tests if
possible.
Thanks,
Nate "fowlduck" Sutton
2007 Oct 04
5
Specs and Libs
How would I go about writing specs for a lib, particularly one with
all protected and private methods. I''m trying to spec the
AuthenticatedSystem library from the rails restful_authentication
plugin:
http://pastie.caboo.se/103625
Also, when you''re mocking objects, a side-effect is helping you
define the api of the object. Is there a way to get all the
behaviors that
2010 Sep 01
2
Undefined methods: has_selector? and flunk
I''m in the process of updating an app for Rails 3.0 and rspec-rails
2.0.0.beta20. When I''m running my specs (rake spec) I get a large number
of errors caused by two undefined methods
undefined method `has_selector?'' for #<String:0x7fdbd0b5b270>
undefined method `flunk'' for
2010 May 07
2
Rspec beta8: helper methods issues
Hello everybody,
I am experiencing the following problems, I googled quickly but I
couldn''t find any documentation or solution to those issues:
1) the generator rails g rspec:helper does nothing;
2) there seems to be no way to test helper methods as I used to do...
for example
the following spec
it ''should set monday as first day of the week'' do