Lint: RSpec/ImplicitSubject

This commit is contained in:
Jared Beck 2019-08-06 01:05:04 -04:00
parent 3a0b12aa67
commit b2377043fa
2 changed files with 6 additions and 11 deletions

View File

@ -29,10 +29,6 @@ RSpec/HooksBeforeExamples:
- spec/paper_trail/request_spec.rb
- spec/paper_trail_spec.rb
RSpec/ImplicitSubject:
Exclude:
- spec/paper_trail/events/base_spec.rb
RSpec/InstanceVariable:
Exclude:
- spec/paper_trail/associations/belongs_to_spec.rb

View File

@ -50,13 +50,12 @@ module PaperTrail
end
describe "#nonskipped_attributes_before_change", versioning: true do
subject { event.send(:nonskipped_attributes_before_change, false) }
let(:event) { PaperTrail::Events::Base.new(skipper, false) }
let(:skipper) { Skipper.create!(another_timestamp: Time.now) }
it do
is_expected.not_to have_key("another_timestamp")
it "returns a hash lacking the skipped attribute" do
# Skipper has_paper_trail(..., skip: [:another_timestamp])
skipper = Skipper.create!(another_timestamp: Time.now)
event = PaperTrail::Events::Base.new(skipper, false)
attributes = event.send(:nonskipped_attributes_before_change, false)
expect(attributes).not_to have_key("another_timestamp")
end
end
end