WagnerMatosUK
WagnerMatosUK

Reputation: 4429

How to configure Cucumber in Rails 4

I'm trying to use Cucumber in a Rails 4. I've added the Cucumber-Rails gem, followed the steps in the instructions but when I wrote step definitions like so:

When(/^I submit a sign up with the following:$/) do |table|
  user = User.create({
      first_name: 'Name',
      last_name: 'Last',
      email: '[email protected]',
      domain: 'example.com',
      password: 'foobar',
      password_confirmation: 'foobar'
    })
end

I get the following error: uninitialized constant User (NameError) ./features/step_definitions/users/sign_up_steps.rb:2:in/^I submit a sign up with the following:$/' features/users/sign_up.feature:4:in When I submit a sign up with the following:'

What am I missing?

Upvotes: 0

Views: 64

Answers (2)

Arvind
Arvind

Reputation: 2781

Please check , it's looking like you have missed the User model

Upvotes: 2

Jun Aid
Jun Aid

Reputation: 504

User model is missing for which you are running tests.

Upvotes: 0

Related Questions