Re: [rspec-users] please help me learn how to use rspec!

2010-02-18 Thread Stephen Smithstone
just a note not the greatest of code but just an attempt On 18/02/2010 21:17, Stephen Smithstone wrote: I to am starting to learn Rspec so i had an attempt at your problem and i came up with this solution http://github.com/ssmithstone/learning_rspec I will expand on this code if

Re: [rspec-users] please help me learn how to use rspec!

2010-02-18 Thread Stephen Smithstone
I to am starting to learn Rspec so i had an attempt at your problem and i came up with this solution http://github.com/ssmithstone/learning_rspec I will expand on this code if you want the render nothing if called with ajax was a puzzler for me as not come across that before as learning rails

Re: [rspec-users] Recall a example inside another (just like in Cucumber)

2010-02-18 Thread Phillip Koebbe
On 18 Feb 2010, at 19:33, Marcelo de Moraes Serpa wrote: Hello guys, I was spec'ing a model and just tried to do something like this it "should create a payment with period_start & period_end set correctly" do it "should create a new payment for an approved transaction"

Re: [rspec-users] Recall a example inside another (just like in Cucumber)

2010-02-18 Thread Matt Wynne
On 18 Feb 2010, at 19:33, Marcelo de Moraes Serpa wrote: Hello guys, I was spec'ing a model and just tried to do something like this it "should create a payment with period_start & period_end set correctly" do it "should create a new payment for an approved transaction"

[rspec-users] Recall a example inside another (just like in Cucumber)

2010-02-18 Thread Marcelo de Moraes Serpa
Hello guys, I was spec'ing a model and just tried to do something like this it "should create a payment with period_start & period_end set correctly" do it "should create a new payment for an approved transaction" previous_payment = Payment.find(Payment.last.id-1) jus

Re: [rspec-users] How to spec accessing a constant

2010-02-18 Thread Marcelo de Moraes Serpa
Why don't you open the class, and set the constant like so: class TheClass CONSTANT = 'value_it_should_have_for_the_current_spec' end This worked for me. Marcelo. On Thu, Oct 16, 2008 at 7:24 PM, Nick Hoffman wrote: > On 2008-10-16, at 15:12, Craig Demyanovich wrote: > >> Cool. Having seen

Re: [rspec-users] please help me learn how to use rspec!

2010-02-18 Thread patrick99e99
Yeah, I have the book.. have read it.. also have watched peepcode's three screencasts on rspec, also have watched the first 7 episodes of BDDCasts. I just am still fuzzy on lots of things, and am hoping someone will be kind enough to go through my spec file and show me what kind of code they would

Re: [rspec-users] have_tag missing assert_select outside of controller/view tests

2010-02-18 Thread Ed Howland
Thanks for the advice, Webrat's have_select or does work with any object that responds to :body. so I've now got it working with Steven Parkes's Env.js port to Johnson w/TraceMonkey. RSpec on Javascript w/o a browser. Sweet. Cheers, Ed Ed Howland http://greenprogrammer.wordpress.com http://twit

Re: [rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread Phillip Koebbe
Joaquin Rivera Padron wrote: those who knows more say the idea is to keep in the example only what is important for the example (but they surely say it even better than me) which is what you are doing +1, greetings, joaquin 2010/2/18 Matt Wynne mailto:m...@mattwynne.net>> On 18 Feb 201

Re: [rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread Joaquin Rivera Padron
those who knows more say the idea is to keep in the example only what is important for the example (but they surely say it even better than me) which is what you are doing +1, greetings, joaquin 2010/2/18 Matt Wynne > > On 18 Feb 2010, at 16:25, m...@franklakatos.com wrote: > > I know we are s

Re: [rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread Matt Wynne
On 18 Feb 2010, at 16:25, m...@franklakatos.com wrote: I know we are suppose to keep specs obvious and readable, but is it normal (or there any opposition) to stubbing every method call that you needed in a before block and simply over-riding the same method with a should_receive in the ac

[rspec-users] Question About Cleaning Up Specs?

2010-02-18 Thread me
I know we are suppose to keep specs obvious and readable, but is it normal (or there any opposition) to stubbing every method call that you needed in a before block and simply over-riding the same method with a should_receive in the actual tested it()? Example describe "#create" do it "s

Re: [rspec-users] please help me learn how to use rspec!

2010-02-18 Thread Phillip Koebbe
patrick99e99 wrote: Hi, So-- I am very very new to BDD.. and I am trying to go over and write The best place to start is the RSpec Book. http://www.pragprog.com/titles/achbd/the-rspec-book Peace, Phillip ___ rspec-users mailing list rspec-us

[rspec-users] please help me learn how to use rspec!

2010-02-18 Thread patrick99e99
Hi, So-- I am very very new to BDD.. and I am trying to go over and write some tests for existing code that has been problematic... I am struggling with knowing exactly how to write the proper specs. So I wrote out a list of things this controller action should do, but as far as how to really ho