Sha256: 6dd7c24d6f861980f963bc0c30535d20ee78c702ca518b1229eea8389c816323

Contents?: true

Size: 961 Bytes

Versions: 8

Compression:

Stored size: 961 Bytes

Contents

require 'spec_helper'

describe "Sunrise Manager Activities" do
  subject { page }
  before(:all) do 
    @admin = FactoryGirl.create(:admin_user, :email => "#{Time.now.to_i}@gmail.com")    

    @post = FactoryGirl.create(:post)
    @user = FactoryGirl.create(:redactor_user)
    @event = @post.create_activity :key => 'post.create', :owner => @user
  end

  context "admin" do
    before(:each) { login_as @admin }

    describe "GET /manage" do
      before(:each) do 
        visit activities_path
      end
      
      it "should show page title" do
        should have_content "Activities"
      end
      
      it "should render records" do
        dom_id = ["activity", @event.id].join('_')
        should have_selector("#" + dom_id)
      end
    end
  end
  
  describe "anonymous user" do
    before(:each) do
      visit activities_path
    end
    
    it "should redirect to login page" do
      should have_content('Sign in')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sunrise-cms-1.0.6 spec/requests/activities_spec.rb
sunrise-cms-1.0.5 spec/requests/activities_spec.rb
sunrise-cms-1.0.4 spec/requests/activities_spec.rb
sunrise-cms-1.0.3 spec/requests/activities_spec.rb
sunrise-cms-1.0.2 spec/requests/activities_spec.rb
sunrise-cms-1.0.1 spec/requests/activities_spec.rb
sunrise-cms-1.0.0 spec/requests/activities_spec.rb
sunrise-cms-1.0.0.rc3 spec/requests/activities_spec.rb