Sha256: 1e8e6446934c051b106641af9fa25126e3449d368d0b84c1649818a8e2cf5c90

Contents?: true

Size: 730 Bytes

Versions: 154

Compression:

Stored size: 730 Bytes

Contents

require 'rails_helper'

describe Users::ConfirmationsController do
  render_views

  before do
    @request.env['devise.mapping'] = Devise.mappings[:user] # rubocop:disable RSpec/InstanceVariable
  end

  describe '#show sin el token' do
    subject { get :show }

    it do
      subject
      expect(response).to have_http_status(:ok)
    end
  end

  describe '#show con el token' do
    subject { get :show, params: { confirmation_token: 'bla' } }

    let(:user) { create :user, confirmed_at: nil, confirmation_token: 'bla' }

    it do
      subject
      expect(response).to have_http_status(:ok)
    end

    it do
      expect { subject }.to change { user.reload.confirmed_at }.from(nil).to(be_present)
    end
  end
end

Version data entries

154 entries across 154 versions & 1 rubygems

Version Path
pg_rails-7.6.7 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.6 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.5 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.4 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.3 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.2 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.1 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.6.0 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.7 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.6 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.5 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.4 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.3 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.2 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.1 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.5.0 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.4.3 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.4.2 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.4.1 pg_engine/spec/controllers/users/confirmations_controller_spec.rb
pg_rails-7.4.0 pg_engine/spec/controllers/users/confirmations_controller_spec.rb