I'm working on writing features for a wizard. The wizard collects
information from a number of different forms, and you can navigate through
it in a number of ways. Anyhow one of these forms is a customer form
collecting name, and email.
In the context of the wizard I feel that the following scena
On Thu, Nov 6, 2008 at 11:28 PM, Joseph Wilk <[EMAIL PROTECTED]>wrote:
> If you are using cucumber with rails and used the rails generator you
> should find in your generated features/steps/env.rb file (In the latest
> cucumber version 0.1.9 this is in features/support/env.rb):
>
Yes, I was alre
A bit dryer:
...
@params = { "login" => "loginator", "email" => "[EMAIL PROTECTED]" }
...
User.should_receive(:new).with(@params).and_return(@user)
...
Ramon Tayag
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listi
Thanks for you reply. With what you said I ended up doing this
before do
@user = mock_model(User, :to_param => "1", :login => "loginator",
:email => "[EMAIL PROTECTED]", :save! => true)
User.stub!(:new).and_return(@user)
@params = { :login => "loginator", :email => "[EMAIL PROTECTED
On Thu, Nov 6, 2008 at 9:53 PM, Ramon Tayag <[EMAIL PROTECTED]> wrote:
> Hey everyone,
>
> I'm trying to spec a controller and I can't seem to get a test to pass
> because rspec seems to see the difference between params I expect and
> params that I pass. However, this comes from the same params
>
Hey everyone,
I'm trying to spec a controller and I can't seem to get a test to pass
because rspec seems to see the difference between params I expect and
params that I pass. However, this comes from the same params
variable. What should I do to get this to work?
Spec::Mocks::MockExpectationErr
> i run "rake spec --trace"
That's not running anything twice, I think. "Invoke" is printed when the
task is called, then the tasks it depends on are invoked, then the task is
executed. The environment task is invoked several times, but it's only
actually executed once.
///
On Thu, Nov 6, 2008 a
Thank you very much Aslak. That looks great. FWIW I have taught a
class "Executable Requirements with FitNesse" as the director of
training and coaching at Valtech and on the faculty of agile
university. I went back to a real job recently and am now employed on
a new enterprise class RoR project as
i run "rake spec --trace"
On 11/6/08, Greg Hauptmann <[EMAIL PROTECTED]> wrote:
> anyone able to explain logic behind "rake spec" startup? i.e. the
> below steps & why things occur when they do
>
> Macintosh-2:myequity greg$ rake spec --trace
> (in /Users/greg/source/myequity)
> ** Invoke spec (fi
On Thu, Nov 6, 2008 at 4:52 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> Fernando Perez <[EMAIL PROTECTED]> writes:
>
>>> And why wouldn't you want to test that?
>>>
>> I want to test for it, it's just that I don't want to copy/paste spec
>> like an idiot.
>>
>>
>>> def for_roles *roles
>>> roles.
On Thu, Nov 6, 2008 at 11:51 PM, Tim Walker <[EMAIL PROTECTED]> wrote:
> Thanks guys, I may have overlooked some of the stuff there. A lot of
> what I was looking for was in the "Step Organization" page.
>
> Still not clear on some of the dynamic substitutions and syntax, etc.
>
I just jotted down
Thanks guys, I may have overlooked some of the stuff there. A lot of
what I was looking for was in the "Step Organization" page.
Still not clear on some of the dynamic substitutions and syntax, etc.
Thanks,
Tim
On Thu, Nov 6, 2008 at 3:22 PM, Joseph Wilk <[EMAIL PROTECTED]> wrote:
> I suggest y
Yes, thank you very much. Not too much there. I had seen a blog post
where Aslak mentioned he'd worked some on the documentation so thought
I was missing the 1000 page tome "Cucumbers: Sometimes quality is long
and green..."
Thanks,
Tim
On Thu, Nov 6, 2008 at 3:05 PM, Ben Mabey <[EMAIL PROTECTED
I suggest you checkout the wiki that Cucumber has on Github .
http://github.com/aslakhellesoy/cucumber/wikis
Lots of useful information.
HTH
--
Joseph Wilk
http://www.joesniff.co.uk
On Thu, Nov 6, 2008 at 9:30 PM, Tim Walker <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> What is the best source for
Stephen Eley wrote:
On Thu, Nov 6, 2008 at 4:32 PM, Wes Gamble <[EMAIL PROTECTED]> wrote:
Attempting to manipulate data directly in the DB in a before/after callback
doesn't make sense since those changes will not persist across tests because
of the transactionality implied by "self.use_trans
On Thu, Nov 6, 2008 at 1:32 PM, Wes Gamble <[EMAIL PROTECTED]> wrote:
> We had an after(:each) callback that looked like this:
>
> PurchaseOrder.find(:all).each {|po|
> DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}}
>
> which we were hoping would reset some purchase orde
Tim Walker wrote:
Hi all,
What is the best source for cucumber documentation. I did the rdoc
thing but that was more of the API view. Is there any usage guides,
etc. besides the examples and what you get when you download it or is
the documentation hidden in there and I just didn't see it.
Many
On Thu, Nov 6, 2008 at 1:07 PM, Greg Hauptmann <
[EMAIL PROTECTED]> wrote:
> I'm still a bit confused - I'll try to be more specific in questions:
>
> * rake db:test:prepare - Check for pending migrations and load the test
> schema
> ==> Q1. DOES NOT RUN IN PENDING MIGRATIONS TO TEST DATABASE?
>
On Thu, Nov 6, 2008 at 4:32 PM, Wes Gamble <[EMAIL PROTECTED]> wrote:
>
> Attempting to manipulate data directly in the DB in a before/after callback
> doesn't make sense since those changes will not persist across tests because
> of the transactionality implied by "self.use_transactional_fixtures
Fernando Perez <[EMAIL PROTECTED]> writes:
>> And why wouldn't you want to test that?
>>
> I want to test for it, it's just that I don't want to copy/paste spec
> like an idiot.
>
>
>> def for_roles *roles
>> roles.each do |role|
>> before(:each) { login_as role }
>> yield
>> end
>> e
Hi all,
What is the best source for cucumber documentation. I did the rdoc
thing but that was more of the API view. Is there any usage guides,
etc. besides the examples and what you get when you download it or is
the documentation hidden in there and I just didn't see it.
Many thanks in advance!
We had an after(:each) callback that looked like this:
PurchaseOrder.find(:all).each {|po|
DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}}
which we were hoping would reset some purchase order data in a certain way.
However, because we have "self.use_transactional_fix
> And why wouldn't you want to test that?
>
I want to test for it, it's just that I don't want to copy/paste spec
like an idiot.
> def for_roles *roles
> roles.each do |role|
> before(:each) { login_as role }
> yield
> end
> end
>
> describe OrdersController do
> describe "GET in
I'm still a bit confused - I'll try to be more specific in questions:
* rake db:test:prepare - Check for pending migrations and load the test schema
==> Q1. DOES NOT RUN IN PENDING MIGRATIONS TO TEST DATABASE?
==> Q2. RE TEST SCHEMA - ARE THE MIGRATIONS USE TO CREATE THE
DATABASE OR THE DEVELO
"Chris Flipse" <[EMAIL PROTECTED]> writes:
> I dunno ... creating a bunch of joining methods seems to be an awfully
> disjoint way to deal with something that is, admittedly, designed to
> laugh in the face of the Law of Demeter.
>
> I've been handling chains through some heavy use of null_object
Cool thanks Fernando, Matt, Nick - it seems like I haven't made my
models fat enough. That seems to be the answer :)
Ramon Tayag
On Fri, Nov 7, 2008 at 12:50 AM, Nick Hoffman <[EMAIL PROTECTED]> wrote:
> On 2008-11-06, at 09:36, Ramon Tayag wrote:
>>
>> How do you test that your controller fet
On 6 Nov 2008, at 00:18, Pat Maddox wrote:
Chuck Norris protects my computer from meteors and all other
catastrophes. I don't need no stinkin' time machine.
Chuck Norris can travel through time. Chuck Norris invented time.
___
rspec-users mailing lis
On 2008-11-06, at 09:36, Ramon Tayag wrote:
How do you test that your controller fetched the right records?
I have an action that returns a different set of records based on
whether or not the current_user is the "owner" of the profile being
viewed.
Code is here http://pastie.org/308685.
"cont
Oh, I guess it makes sense that it wouldn't work there. The stuff in
test.rb is run as part of the initializer block, meaning that Rails
hasn't been set up yet there. I would just stick it all in
spec_helper.rb. That's what I do and was my initial instinct, because
it keeps all the test setup in
On Thu, Nov 6, 2008 at 7:31 AM, Matt Wynne <[EMAIL PROTECTED]> wrote:
> If you want to speed things up, just run spec spec. That will work fine
> unless you have pending migrations that affect your specs.
Or if you have migrations that were applied to the dev db, but you haven't
run db:test:pre
Mark Wilden to rspec-users
show details 7:46 AM (0 minutes ago)
Reply
- Show quoted text -
On Thu, Nov 6, 2008 at 7:02 AM, Fernando Perez <[EMAIL PROTECTED]> wrote:
> On my website each user can have the following roles:
>
> 1) Not logged in
>
> 2) Logged in
> - active
> - administrator
> - sy
woah!
You're exposing way too much of your model here, IMO. That is forcing
you to do all that noisy mocking setup in your before block.
Can you make a method on your user object like User#valid_submissions
and have that return the correct submissions?
How do you know whether the user is
On Thu, Nov 6, 2008 at 10:02 AM, Fernando Perez <[EMAIL PROTECTED]> wrote:
> On my website each user can have the following roles:
>
> 1) Not logged in
>
> 2) Logged in
> - active
> - administrator
> - sysadministrator
>
>
>
> How would you write DRY specs to test each action of a controller?
>
On Thu, Nov 6, 2008 at 4:01 AM, Hongli Lai <[EMAIL PROTECTED]> wrote:
>
>>
>
> 'spec' depends on 'db:test:prepare'. 'db:test:prepare' runs any pending
> migrations on your development database, and copies the schema structure to
> the test database. This is to keep the development database's stru
If you want to speed things up, just run spec spec. That will work
fine unless you have pending migrations that affect your specs.
On 6 Nov 2008, at 12:01, Hongli Lai wrote:
Greg Hauptmann wrote:
anyone able to explain logic behind "rake spec" startup? i.e. the
below steps & why things occur
On Thu, Nov 6, 2008 at 5:59 AM, Togetherne Togetherne
<[EMAIL PROTECTED]>wrote:
> If i create a seperate rake task for each how would i chain them togethr
> to run 1 after eachother?
>
Make a dependency chain. task3 depends on task2 which depends on task1.
///ark
___
On Thu, Nov 6, 2008 at 7:02 AM, Fernando Perez <[EMAIL PROTECTED]> wrote:
> On my website each user can have the following roles:
>
> 1) Not logged in
>
> 2) Logged in
> - active
> - administrator
> - sysadministrator
>
>
>
> How would you write DRY specs to test each action of a controller?
>
Ramon Tayag wrote:
> How do you test that your controller fetched the right records?
>
> I have an action that returns a different set of records based on
> whether or not the current_user is the "owner" of the profile being
> viewed.
>
> Code is here http://pastie.org/308685.
>
> "controller.su
How do you test that your controller fetched the right records?
I have an action that returns a different set of records based on
whether or not the current_user is the "owner" of the profile being
viewed.
Code is here http://pastie.org/308685.
"controller.submissions.size.should == 1" makes sen
On my website each user can have the following roles:
1) Not logged in
2) Logged in
- active
- administrator
- sysadministrator
How would you write DRY specs to test each action of a controller?
Currently I am doing somethings that looks like:
--
describe 'a non admin is signed in', :share
David Chelimsky wrote:
> Why not create different tasks? There's a few ways you can handle that
> and keep control from the command line.
Thanks for the reply, i have managed i think to get half way there!!:
@environment = ["*iehta", "*chrome"]
@environment.each {|browse|
desc("Run all tests in
On Thu, Nov 6, 2008 at 4:52 AM, Togetherne Togetherne
<[EMAIL PROTECTED]> wrote:
> Is this possible, i basically want to create a loop in my Rakefile which
> updates a variable in my spec file with every run the variable is
> something like:
>
> browser = ENV['SELENIUM_RC_BROWSER'] || "*chrome"
>
Greg Hauptmann wrote:
anyone able to explain logic behind "rake spec" startup? i.e. the
below steps & why things occur when they do
Macintosh-2:myequity greg$ rake spec --trace
(in /Users/greg/source/myequity)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_
can someone advise how best to handle the situation where I want to
keep (i.e. not have deleted) my configuration intact?
Perhaps seed it in environment/test.rb - but how do I get a normal
rails line of code to run in the "test.rb" file (i.e. only for when
starting up in test mode)?
I get "ActiveRe
Is this possible, i basically want to create a loop in my Rakefile which
updates a variable in my spec file with every run the variable is
something like:
browser = ENV['SELENIUM_RC_BROWSER'] || "*chrome"
in my spec_helper i have:
def create_selenium_driver
remote_control_server = ENV[
"Mark Wilden" <[EMAIL PROTECTED]> writes:
> On Wed, Nov 5, 2008 at 12:39 PM, Stephen Eley <[EMAIL PROTECTED]> wrote:
>
> My point is that it did not take me days to recover from all this
> screwiness. I was using Time Machine. I booted from the Leopard DVD,
> said "Make it Wednesday
anyone able to explain logic behind "rake spec" startup? i.e. the
below steps & why things occur when they do
Macintosh-2:myequity greg$ rake spec --trace
(in /Users/greg/source/myequity)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (f
47 matches
Mail list logo