Re: [rspec-users] a custom progress bar formatter

2008-12-10 Thread nicholas a. evans
On Tue, Dec 9, 2008 at 8:28 PM, Zach Dennis <[EMAIL PROTECTED]> wrote: > On Tue, Dec 9, 2008 at 5:19 PM, nicholas a. evans <[EMAIL PROTECTED]> wrote: >> And then I remembered that rspec makes it super easy to write your own >> custom formatter. So I did. :-) >> >> http://ekenosen.net/nick/devblog

Re: [rspec-users] assigns variable maintaining state across request?

2008-12-10 Thread David Chelimsky
On Wed, Dec 10, 2008 at 4:08 AM, Ivor Paul <[EMAIL PROTECTED]> wrote: > Hi > > I found that if I set assigns[:variables] in a spec, the value is maintained > in subsequent specs. > > Example > > rails helper method: > > def return_at_variable > @variable > end > > Specs: > > #this passes ob

[rspec-users] assigns variable maintaining state across request?

2008-12-10 Thread Ivor Paul
Hi I found that if I set assigns[:variables] in a spec, the value is maintained in subsequent specs. Example rails helper method: def return_at_variable @variable end Specs: #this passes obviously it 'should return true if assigns[:variable] is true' do assigns[:variable] = true

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Matt Wynne
On 9 Dec 2008, at 19:06, James Byrne wrote: I have decided that for now I am going to use the authlogic gem to provide authentication for the project I am creating. The question arises, since authentication is a user feature request and since it is to be satisfied through the use of a gem (not

[rspec-users] Rspec and RJS - form.reset

2008-12-10 Thread Andrei Erdoss
Hello, I couldn't find much info on this. How do you rspec this: page.form.reset("tag_form") I looked in the have_rjs source code and I can't find anything on form reset. Thanks, -- Andrei ___ rspec-users mailing list rspec-users@rubyforge.org http:

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
Matt Wynne wrote: > On 9 Dec 2008, at 19:06, James Byrne wrote: > >> should >> >> When /authentication by authlogic/ do >> #TODO: Find out how to test for a loaded gem within an application >> end > > If you're working at the level of Cucumber features, I would stay well > away from implementati

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
James Byrne wrote: Of course, the last example should have been: When /user is authenticated/ do # We use Authlogic for authentication so just test that gem is loaded assert defined?("Authlogic") end -- Posted via http://www.ruby-forum.com/. ___ rs

Re: [rspec-users] stepping across features

2008-12-10 Thread Zach Dennis
On Mon, Dec 8, 2008 at 11:56 AM, James Byrne <[EMAIL PROTECTED]> wrote: > Andrew Premdas wrote: >> >> TIp: When writing the step don't use - visits "/invoices/new" - use >> visits "invoice_new_path". Use named routes and let the routing names >> REST and resources define where you go, and think ab

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Ashley Moran
On 10 Dec 2008, at 16:04, James Byrne wrote: Nonetheless, in the step definitions I must test the behaviour in a fashion which first drives and then confirms the implementation details. This is not the path to BDD, it's the path to state-based testing. Matt has already explained this wel

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Matt Wynne
On 10 Dec 2008, at 16:26, James Byrne wrote: James Byrne wrote: Of course, the last example should have been: When /user is authenticated/ do # We use Authlogic for authentication so just test that gem is loaded assert defined?("Authlogic") end To verify that the user has been authenticate

[rspec-users] Oddness with fieldnames containing an underscore

2008-12-10 Thread John Meredith
Hi all, I'm not sure if this is a cucumber or webrat thing given that I only starting tinkering with both last night for the first time (testing newb as well), but I've come across an oddity when trying to write a scenario to create a user. Scenario: Register new user Given I am on

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread James Byrne
Ashley Moran wrote: > > Don't confuse library code with code you write to use this library. > The AuthLogic config in your app is code too, and it adds behaviours > to your app. The fact there are 10, 100 or 10,000 lines of code > behind it is irrelevant. So, if I understand you correctly, then

Re: [rspec-users] Stories, permissions, authorization rules etc.

2008-12-10 Thread Zach Dennis
On Tue, Dec 9, 2008 at 3:52 AM, Andrew Premdas <[EMAIL PROTECTED]> wrote: > You can improve the features you've given by > > 1. use named routes not url's > 2. not checking for not seeing specific things > 3. A combined step with a more examples table >Given I am logged in as a developer

[rspec-users] rspecing rjs - form.reset('form')

2008-12-10 Thread Andrei Erdoss
Hello, > > I couldn't find much info on this. > > How do you rspec this: page.form.reset("form") > > I looked in the have_rjs source code and I can't find anything on form > reset. > > Thanks, > > -- > Andrei > ___ rspec-users mailing list rspec-users@ru

Re: [rspec-users] Oddness with fieldnames containing an underscore

2008-12-10 Thread Andrew Premdas
Probably not a bug, if you look at the id's of the fields your matching by viewing source in your browser you'll see that they have an id that begins with 'user'. So when webrat fails to match on the label text it then tries to match on the id. You can use the debugger to step into the webrat code

[rspec-users] The TODO note in rspec files can't be shown in "rake notes"

2008-12-10 Thread Kai Fu
Hello, I've written a "TODO" comment in a xxx_controller_spec.rb. When I run the "rake notes" command, it doesn't appear in the output, while other notes written in the "app" dir are shown correctly. Could someone tell me how to fix this? Whether I should hack the rails rake code? Thanks! -- r

Re: [rspec-users] stepping across features

2008-12-10 Thread James Byrne
Zach Dennis wrote: > > You're getting there. If anyone asks you are triangulating the target > so you can determine exactly where it lies. To a certain extent, we > all are. =) I think that I am reaching the stage where I am oscillating between over and under specifying. I am trying this stuff

Re: [rspec-users] New article on "Listening to Your Specs" up on Ruby Advent 2008

2008-12-10 Thread Bart Zonneveld
On 10 dec 2008, at 04:40, Avdi Grimm wrote: I contributed an article on BDD and RSpec to the Ruby Advent Calendar 2008, going over some of the rules I've collected for interpreting what your specs say about your design. It can be found here: http://advent2008.hackruby.com/past/2008/12/10/ lis

Re: [rspec-users] Test for a gem/plugin?

2008-12-10 Thread Andrew Premdas
I put a starter application with a bunch of features to test authorisation code implemented by Restful Authentication on Github a few days ago. In theory you could apply these features directly to your Authlogic implementation. http://github.com/diabolo/fbrp/tree/master All best Andrew 2008/12/