Sha256: d6e2d6e986ce94e1a6aa22eff6f9295a8dbb2a4b1102961062f8e353f6b5b542

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe "Authentication" do

	subject { page }

	describe 'sign in page' do
	    before { visit adminpanel.signin_path }

	    it { should have_content(I18n.t("authentication.welcome")) }

	    it { expect(page).to have_title(I18n.t("Panel title")) }
	end

    describe 'signin' do
	    before { visit adminpanel.signin_path }

	    describe 'with invalid information' do
      	before do
          click_button 'signin-button'
        end

	    	it { expect(page).to have_title(I18n.t("Panel title")) }
      	it { should have_selector('div.alert.alert-error', :text => I18n.t('authentication.signin_error')) }
	    end

	    describe 'with valid information' do
	    	let(:user) { FactoryGirl.build(:user) }
	    	before do
	    		valid_signin_as_admin(user)
	    	end

	    	it { should have_selector('div.alert.alert-success', :text => I18n.t('authentication.signin_success')) }
	    	it { should have_selector('i.fa-power-off') }

	    	describe 'signing out' do
	    		before { click_link 'signout-button'}

	    		it { current_path.should == adminpanel.signin_path }
	    		it { expect(page).to have_title(I18n.t("Panel title")) }

	    	end
	    end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adminpanel-2.1.0 spec/features/authentication_pages_spec.rb
adminpanel-2.0.1 spec/features/authentication_pages_spec.rb
adminpanel-2.0.0 spec/features/authentication_pages_spec.rb