Sha256: d5e9106c9de280f064ae8169e6673c90b68a4393818c9d922b653a0ee60d129b

Contents?: true

Size: 1.13 KB

Versions: 12

Compression:

Stored size: 1.13 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 { click_button "signin-button" }

	    	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) { Factory(:user) }
	    	before do
	    		valid_signin(user)
	    	end

	    	it { should have_selector('div.alert.alert-success', :text => I18n.t("authentication.signin success")) }
	    	it { should have_selector('i.icon-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

12 entries across 12 versions & 1 rubygems

Version Path
adminpanel-1.2.9 spec/features/authentication_pages_spec.rb
adminpanel-1.2.8 spec/features/authentication_pages_spec.rb
adminpanel-1.2.7 spec/features/authentication_pages_spec.rb
adminpanel-1.2.6 spec/features/authentication_pages_spec.rb
adminpanel-1.2.5 spec/features/authentication_pages_spec.rb
adminpanel-1.2.4 spec/features/authentication_pages_spec.rb
adminpanel-1.2.3 spec/features/authentication_pages_spec.rb
adminpanel-1.2.2 spec/features/authentication_pages_spec.rb
adminpanel-1.2.1 spec/features/authentication_pages_spec.rb
adminpanel-1.2.0 spec/features/authentication_pages_spec.rb
adminpanel-1.1.0 spec/features/authentication_pages_spec.rb
adminpanel-1.0.0 spec/features/authentication_pages_spec.rb