Sha256: 40b9e503d87e4528b6f87b33f40e3163c4aacd44a5111cd0b2c168aa18015df8

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require 'rails_helper'

# Protected attributes are not supported by rails 5
if Rails.version.starts_with?('4')
  RSpec.describe DeviseG5Authenticatable::Models::ProtectedAttributes do
    before do
      Dummy::Application.config.active_record.whitelist_attributes = true
    end

    after do
      Dummy::Application.config.active_record.whitelist_attributes = false
    end

    subject { model }

    let(:model_class) { User }
    let(:model) { model_class.new }

    it { is_expected.to allow_mass_assignment_of(:email) }
    it { is_expected.to allow_mass_assignment_of(:password) }
    it { is_expected.to allow_mass_assignment_of(:password_confirmation) }
    it { is_expected.to allow_mass_assignment_of(:provider) }
    it { is_expected.to allow_mass_assignment_of(:uid) }
    it { is_expected.not_to allow_mass_assignment_of(:g5_access_token) }
    it { is_expected.to allow_mass_assignment_of(:current_password) }
    it { is_expected.to allow_mass_assignment_of(:updated_by) }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
devise_g5_authenticatable-1.0.3 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.2.rc.3 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.2.rc.2 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.2.rc.1 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.1.rc.1 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.0 spec/models/protected_attributes_spec.rb
devise_g5_authenticatable-1.0.0.pre.1 spec/models/protected_attributes_spec.rb