Files
grecia/spec/helpers/application_helper_spec.rb
Bertocq ed16a78f42 Enables RSpec/ExampleWording and fixes all issues
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
2018-01-07 01:03:45 +01:00

27 lines
664 B
Ruby

require 'rails_helper'
describe ApplicationHelper do
describe "#author_of?" do
it "is true if user is the author" do
user = create(:user)
proposal = create(:proposal, author: user)
expect(author_of?(proposal, user)).to eq true
end
it "is false if user is not the author" do
user = create(:user)
proposal = create(:proposal)
expect(author_of?(proposal, user)).to eq false
end
it "is false if user or authorable is nil" do
user = create(:user)
proposal = create(:proposal)
expect(author_of?(nil, user)).to eq false
expect(author_of?(proposal, nil)).to eq false
end
end
end