Sha256: ee46fda85a599fb91439ff7c722f7dd97a31ed6d1f66c73296cdc829b3817f64
Contents?: true
Size: 656 Bytes
Versions: 12
Compression:
Stored size: 656 Bytes
Contents
# -*- encoding : utf-8 -*- module OmniauthLoginTestHelper def current_user @current_user ||= Factory.create(:user) end def login! session[:user_id] = current_user.id end end RSpec.configure do |config| config.include OmniauthLoginTestHelper, :type => :controller config.include OmniauthLoginTestHelper, :type => :helper end shared_examples_for "authentication_required_action" do context "not logged in" do before do http_basic_login! request.env["HTTP_REFERER"] = '/back' do_action end it { should redirect_to("/back") } it { flash[:notice].should == "VocĂȘ precisa estar logado..." } end end
Version data entries
12 entries across 12 versions & 1 rubygems