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
19 lines
448 B
Ruby
19 lines
448 B
Ruby
require 'rails_helper'
|
|
|
|
describe Valuator do
|
|
|
|
describe "#description_or_email" do
|
|
it "returns description if present" do
|
|
valuator = create(:valuator, description: "Urbanism manager")
|
|
|
|
expect(valuator.description_or_email).to eq("Urbanism manager")
|
|
end
|
|
|
|
it "returns email if not description present" do
|
|
valuator = create(:valuator)
|
|
|
|
expect(valuator.description_or_email).to eq(valuator.email)
|
|
end
|
|
end
|
|
end
|