require 'spec_helper'

describe "the user is not a fixxpert" do

  let(:customer) { create :customer }

  it "should not see the manage subtrades link" do
    login_as_user customer
    page.should_not have_css "#fixxpert_subtrades_link"
  end

  it "should not be allowed to visit the manage subtrades page" do
    login_as_user customer
    visit fixxpert_subtrades_path
    current_path.should eq home_path
  end

end

describe "the fixxpert clicks the manage subtrades button" do
  it "should be redirected to the manage subtrades page" do
    fixxpert = create :fixxpert
    login_as_user fixxpert
    click_link "fixxpert_subtrades_link"
    current_path.should eq fixxpert_subtrades_path
  end
end
