Thursday, 19 September 2013

cucumber testing scenario fails while using before filter?

cucumber testing scenario fails while using before filter?

I have referred link
http://railscasts.com/episodes/155-beginning-with-cucumber for testing.
But when i use before_filter :authenticate_user! in my controller my all
cases are failing and when i commented the before filter my all test cases
are passing. I am getting following error.
Scenario: Create Valid Article
Given I have no articles
And I am on the list of articles
When I follow "New Article"
Unable to find link "New Article" (Capybara::ElementNotFound)
./features/step_definitions/article_steps.rb:25:in `/^I follow
"([^\"]*)"$/'
features/manage_articles.feature:15:in `When I follow "New Article"'
And I fill in "article[title]" with "Spuds"
And I fill in "Content" with "Delicious potato wedges!"
And I press "Create"
Then I should see "New article created."
And I should see "Spuds"
And I should see "Delicious potato wedges!"
And I should have 1 article
Failing Scenarios:
cucumber features/manage_articles.feature:12 # Scenario: Create Valid
Article
2 scenarios (1 failed, 1 passed) 14 steps (1 failed, 7 skipped, 6 passed)

No comments:

Post a Comment