Sha256: e87a2e1bc33d45ede2ff834435089829357a5ca1d10ea25c67e6c48836ac69c5

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

require 'test_helper'

module PushType
  class Admin::UsersControllerTest < ActionController::TestCase

    let(:current_user) { FactoryBot.create(:confirmed_user) }
    let(:user) { FactoryBot.create :user }
    before { sign_in current_user }

    let(:last_email) { ActionMailer::Base.deliveries.last }
    
    describe 'PUT #invite' do
      let(:referer) { '/push_type/users' }
      before do
        @request.env["HTTP_REFERER"] = referer
        put :invite, params: { id: user.id }
      end
      it { response.must_redirect_to referer }
      it { last_email.to.must_include user.email }
      it { last_email.subject.must_include 'Confirm your account' }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_type_auth-0.12.1 test/controllers/push_type/admin/users_controller_test.rb
push_type_auth-0.12.0 test/controllers/push_type/admin/users_controller_test.rb
push_type_auth-0.12.0.beta.1 test/controllers/push_type/admin/users_controller_test.rb