require 'spec_helper'

describe 'deleting a group' do
  it 'should delete the group and return to the index page' do
    customer = create :customer
    group1 = create :group, customer: customer
    login_as_user customer
    click_link 'Get the Scoop'
    click_link 'Discussions'
    within '#groups_index'do
      click_link "delete_group_#{group1.id}"
    end

    current_path.should eq customer_groups_path
    within '.jcarousel-skin-tango' do
      page.should_not have_content group1.name
    end
  end
end
