[rspec-users] fixtures in stories
Ingo Weiss
ingo at ingoweiss.com
Tue Jan 15 10:23:49 EST 2008
Thanks, Chris!
This is how I create most of my data for stories. However, I have one
case (globalize languages/countries) where loading the data from
fixtures seems to make more sense. Also, I would like to load them in
one place, globally for all stories, as you can do in spec_helper, in
order to not have to include a 'Given language ...' in all of my
stories. Is that possible?
Ingo
On Jan 15, 2008, at 4:07 PM, Chris Parsons wrote:
> Hi Ingo,
>
> On 15 Jan 2008, at 14:55, Ingo Weiss wrote:
>
>> how/where do I load fixtures in stories?
>
> Try loading your data up manually using 'Given' blocks:
>
> (my_story.txt)
> Given a user called Bob
> And a user called Charlie
>
> and:
>
> (steps.rb)
> Given "a user called $name" do |name|
> User.create! :name => name
> end
>
> Hope this helps
> Chris
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list