> That does look rather terse -- but notice that all your steps are
> showing up as skipped.  I'd say you've got a configuration issue.  Check
> your cucumber setup.

So it was a configuration error, having to do with my discovery that the
config/environment/cucumber.rb environment which was missing some app
specific constants, which in turn was causing my loading of fixtures to fail
(albeit unreported).

Now another issue: I have my test::unit fixtures loading and confirmed (this
is a legacy app). However they can not seem to be accessed from the code.
This is what is in env.rb to load them:

Before do
  Fixtures.reset_cache
  fixtures_folder = File.join(RAILS_ROOT, 'test', 'fixtures')
  fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f|
File.basename(f, '.yml') }
  Fixtures.create_fixtures(fixtures_folder, fixtures)
end

Then for example, in the cucumber step below, when I set the debugger, I can
find, the specific users fixture through
Fixtures.all_loaded_fixtures["users"]["sysadmin_user_one"]

But I can not get at its data (maybe you can tell me how to get at a class
attribute inside a fixture object):

(rdb:1) Fixtures.all_loaded_fixtures["users"]["sysadmin_user_one"]
#<Fixture:0x47776a4 @model_class=User(id: integer, login: string,
first_name: string, last_name: string, email: string, role_id: integer,
hashed_password: string, salt: string, created_at: datetime, updated_at:
datetime, enabled: boolean, account_id: integer, email_upon_upload:
boolean), *...@fixture={"salt"=>987654, "created_at"=>"2010-09-16 18:13:09",
"updated_at"=>"2010-09-16 18:13:09", "role_id"=>1033329129,
"hashed_password"=>"501d40d3a18d954855335c06bd56d47f8f5d4adc",
"id"=>1067249891, "enabled"=>true, "last_name"=>"One",
"login"=>"sysadminone", "email"=>"sysadmin...@gmail.com",
"first_name"=>"Sysadmin"},*

And using "users(:user_name)" as I would in Test::Unit does not work - this
is where the step is failing.

I hope this is not as disgusting as I am making it... am I fighting the
universe (or in this case Cucumber::Rails::World) on this?

Given /^I am logged in as a sysadmin user$/ do
  user = users(:sysadmin_user_one)
  visit('/login')
  fill_in('login', user.login)
  fill_in('password', 'password1')
  click_button('Log in')
  I should see 'Welcome Sysadmin One'
end


Thanks,

David

On Wed, Sep 15, 2010 at 7:11 PM, Marnen Laibow-Koser
<li...@ruby-forum.com>wrote:

> David Kahn wrote:
> >> You know, if you're going to complain about the output, the least you
> >> could do is show us the output you're getting... :)
> >
> > Here goes:
> >
> > /Users/DK/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -I
> > "/Users/DK/.rvm/gems/ruby-1.8.7-p174/gems/cucumber-0.8.5/lib:lib"
> > "/Users/DK/.rvm/gems/ruby-1.8.7-p174/gems/cucumber-0.8.5/bin/cucumber"
> > --profile default
> > Using the default profile...
> > F-----F--
> >
> > Failing Scenarios:
> > cucumber features/create_comparison.feature:6 # Scenario: Comparisons
> > List
> > cucumber features/login_logout.feature:3 # Scenario: Login
> >
> > 2 scenarios (2 failed)
> > 7 steps (7 skipped)
> > 0m0.042s
> > rake aborted!
> > Command failed with status (1):
> > [/Users/DK/.rvm/rubies/ruby-1.8.7-p174/bin/...]
>
> That does look rather terse -- but notice that all your steps are
> showing up as skipped.  I'd say you've got a configuration issue.  Check
> your cucumber setup.
>
> >
> > (See full trace by running task with --trace)
> > DKMac:creditcompare DK$
> >
> >
> > On Wed, Sep 15, 2010 at 5:06 PM, Marnen Laibow-Koser
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org
>
> Sent from my iPhone
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to