Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created July 30, 2016 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7f9d59f1e9e3ea3f5e1f6adcbc1c0c1b to your computer and use it in GitHub Desktop.
Save anonymous/7f9d59f1e9e3ea3f5e1f6adcbc1c0c1b to your computer and use it in GitHub Desktop.
# Error
uninitialized constant Employee (NameError)
./features/step_definitions/adding_employees_steps.rb:20:in `/^I should be able to enter employee details$/'
features/my.feature:8:in `Then I should be able to enter employee details'
# Error If i call FactoryGirl.find_definitions twice
Factory already registered: employee (FactoryGirl::DuplicateDefinitionError)
./spec/factories.rb:4:in `block in <top (required)>'
./spec/factories.rb:3:in `<top (required)>'
./features/step_definitions/adding_employees_steps.rb:19:in `/^I should be able to enter employee details$/'
features/my.feature:8:in `Then I should be able to enter employee details'
# spec/factories.rb
require 'factory_girl'
FactoryGirl.define do
factory :employee do
first_name 'FirstName'
last_name 'LastName'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment