Topic: error in controller action only in cucumber, not in browser...
Feature: User Sessions So that I can have proper access As a registered user I want to log in and log out Scenario: log in # features/user_sessions.feature:7 Given I am a registered user # features/step_definitions/user_sessions_steps.rb:16 And I am on the homepage # features/step_definitions/web_steps.rb:14 undefined method `name' for nil:NilClass (NoMethodError) ./app/controllers/webpages_controller.rb:23:in `show' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' (eval):2:in `visit' ./features/step_definitions/web_steps.rb:15:in `/^(?:|I )am on (.+)$/' features/user_sessions.feature:9:in `And I am on the homepage' Failing Scenarios: cucumber features/user_sessions.feature:7 # Scenario: log in 1 scenario (1 failed) 2 steps (1 failed, 1 passed) 0m0.243s /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Library/Ruby/Gems/1.8/gems/cucumber-0.6.2/bin/cucumber --format pretty --format rerun --out /var/folders/SY/SYCFBso-HzCi-GcKlkw3UE+++TI/-Tmp-/autotest-cucumber20100213-660-1tvfy3h-0 features/user_sessions.feature:7 features/step_definitions features/support
controller show action:
@webpage = Webpage.find_by_home_page(true) @permalink = @webpage.name # <-- this is what is failing
>> Webpage.find_by_home_page(true).name Webpage Load (0.3ms) SELECT * FROM `webpages` WHERE (`webpages`.`home_page` = 1) LIMIT 1 => "Home"
Scenario: log in Given I am a registered user And I am on the homepage
def path_to(page_name) case page_name when /the homepage/ '/' ...
going to localhost:3000/ works fine in the browser...
Last edited by patrick99e99 (2010-02-14 01:01:22)