I'm attempting to run cucumber tests of my application over capybara with selenium driver. Within the test steps i dynamically create customers to login towards the application . However the user login fails using the user i've produced. I've set the consumer_transactional_fixture to false. Still the produced records aren't open to the selenium application.

This is actually the code

Feature File

@browser Scenario: Admin alone can get access to admin pages Given "admin@example.com" is really a admin After I have drenched in as "admin@example.com" step definition file

Given /"([^"]*)" is really a admin/ do email

user = Email.active.find_by_address(email).try(:user) User.new(, :password =>

'Monkey_123', :password_confirmation => 'Monkey_123', :last_title => 'example', :first_title => 'admin')

user.update_attribute(:condition, "active")

user.update_attribute(:terms_and_conditions_recognized, 1)

user.groups << Group.find(1)

user.primary_email = Email.new(:address => email, :condition => Email::Condition::ACTIVE,

:email_type => Email::Type::PRIMARY)

user.save!

after i run the tests using capybara and selenium driveri am not able to login to my application using

the produced user with the browser.

I attempted while using ruby debugger, which demonstrated the development of the specific user.

Following is my config within the env.rb file

if defined?(ActiveRecord::Base)

begin

require 'database_cleaner'

DatabaseCleaner.strategy = :truncation

rescue LoadError => ignore_if_database_cleaner_not_present

finish

finish

Capybara.server_port = 9887 # Or whatever number you would like?

Capybara.application_host = "http://localhost:#"

Capybara.default_wait_time = 4

Capybara.ignore_hidden_elements=false

Before('@browser') do Capybara.current_driver = :selenium finish

Kindly advise a solution with this. The gems versions are 1) cucumber -v .10.7

2)cucumber-rails .3.2

3)Capybara .4.1.2

4) database_cleaner .5.

Thanks