diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0fb5144f..409202a6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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 diff --git a/spec/paper_trail/events/base_spec.rb b/spec/paper_trail/events/base_spec.rb index b4f86a6b..13e1cdbe 100644 --- a/spec/paper_trail/events/base_spec.rb +++ b/spec/paper_trail/events/base_spec.rb @@ -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