Sha256: c1e66e2305d36b90086767b0679dbff7227bed23f9d31905b6e4be33fe49fa31

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

feature "What's-new Box on root#index" do
  include SessionSteps
  
  background do
    @user = create :user_with_account
    @group = create :group
    @group.assign_user @user, at: 1.year.ago
    @other_group = create :group
    
    @page_of_group = @group.child_pages.create title: 'Page of a group the user is member of'
    @page_of_other_group = @other_group.child_pages.create title: 'Page of a group the user is NOT member of'
    @page_without_group = create :page, title: 'Page without a group, i.e. a global page'
  end
  
  scenario 'Looking at the what-is-new box on root#index' do
    login @user
    visit root_path
    
    within '.box.what_is_new' do
      
      # List the pages of the groups the user is member of
      page.should have_text @page_of_group.title
      
      # Do not list the pages of groups the user is not member of
      page.should have_no_text @page_of_other_group.title
      
      # List the pages without group, i.e. "global pages"
      page.should have_text @page_without_group.title
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
your_platform-1.0.1 spec/features/what_is_new_box_spec.rb
your_platform-1.0.0 spec/features/what_is_new_box_spec.rb
your_platform-0.0.2 spec/features/what_is_new_box_spec.rb