Sha256: baf39859851c88fe528f76706c17b1ce9b22258047e258a8a7f287bbe38c8cc4

Contents?: true

Size: 602 Bytes

Versions: 22

Compression:

Stored size: 602 Bytes

Contents

RSpec.shared_examples 'Nyauth::Confirmable' do |klass|
  let!(:instance) { create(klass.name.downcase.to_sym, :requested_confirmation) }

  describe '#confirm' do
    subject { instance.confirm }
    before { Timecop.freeze }
    after { Timecop.return }

    it do
      expect {
        subject
      }.to change(instance, :confirmed?).from(false).to(true)
    end

    it do
      expect {
        subject
      }.to change(instance, :confirmed_at).from(nil).to(Time.current)
    end

    it do
      expect {
        subject
      }.to change(instance, :confirmation_key).to(nil)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
nyauth-0.7.2 spec/support/models/nyauth/confirmable.rb
nyauth-0.7.1 spec/support/models/nyauth/confirmable.rb
nyauth-0.7.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.6.2 spec/support/models/nyauth/confirmable.rb
nyauth-0.6.1 spec/support/models/nyauth/confirmable.rb
nyauth-0.6.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.5.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.4.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.3.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.8 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.7 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.6 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.5 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.4 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.3 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.2 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.1 spec/support/models/nyauth/confirmable.rb
nyauth-0.2.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.1.0 spec/support/models/nyauth/confirmable.rb
nyauth-0.0.3 spec/support/models/nyauth/confirmable.rb