Both avoiding 'should' and repiting 'it' on the tests description improves reading them and also makes all descriptions consistent. Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
13 lines
374 B
Ruby
13 lines
374 B
Ruby
require 'rails_helper'
|
|
|
|
describe Poll::OfficerAssignment do
|
|
it "logs user data on creation" do
|
|
user = create(:user, username: "Larry Bird", email: "larry@lege.nd")
|
|
officer = create(:poll_officer, user: user)
|
|
|
|
oa = create(:poll_officer_assignment, officer: officer)
|
|
|
|
expect(oa.reload.user_data_log).to eq "#{user.id} - Larry Bird (larry@lege.nd)"
|
|
end
|
|
end
|