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.27 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.26 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.25 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.24 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.24.pre.5 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.24.pre.4 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.24.pre.3 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.23 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.22 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.22.pre.3 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.22.pre.2 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.22.pre.1 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.11 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.10 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.9 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.8 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.7 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.6 pg_engine/spec/requests/current_attributes_spec.rb
pg_rails-7.6.21.pre.5 pg_engine/spec/requests/current_attributes_spec.rb