Sha256: 08f2b8d1b04d5291c829b473238c2f4895ce51228dcabf7ee3604f51deaab1f6

Contents?: true

Size: 608 Bytes

Versions: 49

Compression:

Stored size: 608 Bytes

Contents

require 'rails_helper'

describe 'current attributes' do
  it 'Current gets reset between requests' do
    allow(Current).to receive(:namespace=)
    allow(Current.instance).to receive(:reset)
    get '/contacto/new'
    expect(Current).to have_received(:namespace=).with(:public)
    expect(Current.instance).to have_received(:reset).at_least(:twice)
    expect(Current.namespace).to be_nil
  end

  it 'sets a current attribute' do
    Current.user = 1
    expect(Current.namespace).to be_nil
  end

  it 'the attribute gets reset' do
    Current.namespace = 2
    expect(Current.user).to be_nil
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
pg_rails-7.6.21.pre.4 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.3 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.2 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.1 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.20 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.19 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.18 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.17 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.16 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.15 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.14 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.13 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.12 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.11 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.10 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.9 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.8 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.7 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.6 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.5 pg_engine/spec/requests/current_attributes_spec.rb