require 'rails_helper'

describe 'adding work days to a project' do
  before :each do
    @user = FactoryGirl.create(:user)
    FactoryGirl.create(:contract, hiwi: @user)
    @project = FactoryGirl.create(:project, title: 'AddWorkingHours')
    @project.users << @user
    login_as @user
  end

  it 'is possible from a project\'s index page' do
    visit project_path(@project)
    click_on I18n.t('projects.show.add_working_hours')
    expect(current_path).to eq(new_work_day_path)
  end
end

Add test for adding work days from project index
test(project/AddWorkDays): Add test for adding work days from project index

Regression test: Following the 'add working hours' link on a project's index page lead to an 'undefined method' error.
