I have a users factory:
FactoryGirl.define do
factory :user, :aliases => [:assignee] do
sequence(:email) { |n| "foo#{n}@example.com" }
sequence(:username) { |n| "foo#{n}@example.com" }
profile
end
end
And a jobs factory:
FactoryGirl.define do
factory :job do
association :assignee, factory: :user
description "MyText"
completion_comment "MyText"
job_type "MyString"
...
end
end
Which are loaded into my jobs_feature_spec_helper:
def add_valid_job
click_job
within("#add_job") do
select 'foo1@example.com', from: 'Assignee'
fill_in_html("job__textarea", {:with => job[:description]})
click_button "Save"
end
end
My feature page spec passes in RSpec on my machine, but my employer sent me an email saying that the spec failed in Jenkins. Here's the message he sent:
Unable to find option "foo1@example.com <mailto:foo1@example.com>"
./spec/support/job_feature_spec_helpers.rb:11:in `block in add_valid_job'
./spec/support/job_feature_spec_helpers.rb:10:in `add_valid_job'
./spec/features/jobs/edit_job_line_spec.rb:8:in `block (2 levels) in <top (required)>'
So, it appears that when Jenkins runs the spec, it's not finding the assignee from the drop-down list, yet RSpec is. I have never personally used Jenkins, so if anyone has any advice that may help, I'd appreciate hearing it. Thanks!