Sha256: 640c2d44a81bbaad251b77d780b7b2bf016caa12655908b86c35f3b74f510341

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe "Security: " do

  before do
    Alchemy::Page.root.children.destroy_all
    Alchemy::User.delete_all
  end

  context "If no user is present" do

    it "render the signup view" do
      visit '/alchemy'
      current_path.should == '/alchemy/admin/signup'
    end
  end

  context "If user is present" do

    before do
      create_admin_user
    end

    it "a visitor should not be able to signup" do
      visit '/alchemy/admin/signup'
      within('#alchemy_greeting') { page.should_not have_content('have to signup') }
    end

    context "that is not logged in" do
      it "should see login-form" do
        visit '/alchemy/admin/dashboard'
        current_path.should == '/alchemy/admin/login'
      end
    end

    context "that is already logged in" do

      before do
        login_into_alchemy
      end

      it "should be redirected to dashboard" do
        visit '/alchemy/admin/login'
        current_path.should == '/alchemy/admin/dashboard'
      end

    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-2.5.3.1 spec/integration/security_spec.rb
alchemy_cms-2.5.3 spec/integration/security_spec.rb
alchemy_cms-2.5.2.2 spec/integration/security_spec.rb
alchemy_cms-2.5.2.1 spec/integration/security_spec.rb
alchemy_cms-2.5.2 spec/integration/security_spec.rb
alchemy_cms-2.5.1 spec/integration/security_spec.rb
alchemy_cms-2.5.0 spec/integration/security_spec.rb
alchemy_cms-2.5.0.rc3 spec/integration/security_spec.rb
alchemy_cms-2.5.0.b9 spec/integration/security_spec.rb