Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Failing Scenario, attempting to select test client from work unit client id
- @javascript
- Scenario: Register new work unit
- Given I am an authenticated user with an admin role
- And a client "test client" exists with name: "test client", initials: "TTC"
- And a project "test project" exists with name: "test project", client: client "test client"
- And a ticket "test ticket" exists with project: project "test project", name: "test ticket"
- And I visit /
- Then show me the page
- When I select "test client" from "work_unit_client_id"
- And I select "test project" from "work_unit_project_id"
- And I select "test ticket" from "work_unit_ticket_id"
- And I select "Overtime" from "hours_type"
- And I fill in "Hours" with "2"
- And I fill in "work_unit_description" with "test description"
- And I press "Create Work Unit"
- Then I should see "TTC: 3.0" within ".overtime"
- ##Error
- No such option 'test client' in this select box. Available options: 'Select a client', 'test client', 'Select a project', 'Select a client', 'test client', 'Select a project', 'Select a ticket', 'Normal', 'Overtime', 'CTO', 'PTO' (Capybara::OptionNotFound)
- ./features/step_definitions/web_steps.rb:76:in `block (2 levels) in <top (required)>'
- ./features/step_definitions/web_steps.rb:14:in `with_scope'
- ./features/step_definitions/web_steps.rb:75:in `/^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/'
- features/manage_work_units.feature:14:in `When I select "test client" from "work_unit_client_id"'
- ##The partial
- #add_work_unit
- %h3.dashboard_title= t(:add_work_unit)
- = form_for WorkUnit.new(params[:work_unit]) do |f|
- #work_unit_errors
- .work_unit_field
- %label= "#{t(:scheduled_on)}:"
- = link_to Date.current, "#", :id => "schedule_modal_link"
- #schedule_modal
- %p= t(:enter_work_units_on_completion_day)
- .work_unit_field
- %label= t(:scheduled_at)
- = text_field_tag :scheduled_at, Date.current
- .work_unit_field
- %label{:for => "work_unit_client_id"}= "#{t(:client)}:"
- = collection_select("work_unit", "client_id", @clients, "id", "name", { :prompt => t(:select_a_client) })
- .work_unit_field
- %label{:for => "work_unit_project_id"}= "#{t(:project)}:"
- = collection_select("work_unit", "project_id", @projects, "id", "name", { :prompt => t(:select_a_project) })
- .work_unit_field
- %label{:for => "work_unit_ticket_id"}= "#{t(:ticket)}:"
- = collection_select("work_unit", "ticket_id", @tickets, "id", "name", { :prompt => t(:select_a_ticket) })
- .work_unit_field
- %label{:for => "work_unit_hours_type"}= "#{t(:type)}:"
- = select_tag("hours_type", options_for_select(['Normal', 'Overtime', 'CTO', 'PTO']))
- .work_unit_field
- %label{:for => "work_unit_hours"}= "#{t(:hours).capitalize}:"
- = f.text_field :hours, { :size => 10 }
- .work_unit_field
- %label{:for => "work_unit_description"}= "#{t(:description)}:"
- = f.text_area :description, { :rows => 10, :style => "resize: none;"}
- .work_unit_field
- = f.hidden_field :scheduled_at, :value => Date.current
- = f.submit t(:create_work_unit), :class => 'add_new_button'
Add Comment
Please, Sign In to add comment