Guest User

Untitled

a guest
Oct 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. ##Failing Scenario, attempting to select test client from work unit client id
  2. @javascript
  3. Scenario: Register new work unit
  4. Given I am an authenticated user with an admin role
  5. And a client "test client" exists with name: "test client", initials: "TTC"
  6. And a project "test project" exists with name: "test project", client: client "test client"
  7. And a ticket "test ticket" exists with project: project "test project", name: "test ticket"
  8. And I visit /
  9. Then show me the page
  10. When I select "test client" from "work_unit_client_id"
  11. And I select "test project" from "work_unit_project_id"
  12. And I select "test ticket" from "work_unit_ticket_id"
  13. And I select "Overtime" from "hours_type"
  14. And I fill in "Hours" with "2"
  15. And I fill in "work_unit_description" with "test description"
  16. And I press "Create Work Unit"
  17. Then I should see "TTC: 3.0" within ".overtime"
  18.  
  19. ##Error
  20.  
  21.  
  22. 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)
  23. ./features/step_definitions/web_steps.rb:76:in `block (2 levels) in <top (required)>'
  24. ./features/step_definitions/web_steps.rb:14:in `with_scope'
  25. ./features/step_definitions/web_steps.rb:75:in `/^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/'
  26. features/manage_work_units.feature:14:in `When I select "test client" from "work_unit_client_id"'
  27.  
  28.  
  29. ##The partial
  30.  
  31.  
  32. #add_work_unit
  33. %h3.dashboard_title= t(:add_work_unit)
  34.  
  35. = form_for WorkUnit.new(params[:work_unit]) do |f|
  36. #work_unit_errors
  37. .work_unit_field
  38. %label= "#{t(:scheduled_on)}:"
  39. = link_to Date.current, "#", :id => "schedule_modal_link"
  40.  
  41. #schedule_modal
  42. %p= t(:enter_work_units_on_completion_day)
  43. .work_unit_field
  44. %label= t(:scheduled_at)
  45. = text_field_tag :scheduled_at, Date.current
  46.  
  47. .work_unit_field
  48. %label{:for => "work_unit_client_id"}= "#{t(:client)}:"
  49. = collection_select("work_unit", "client_id", @clients, "id", "name", { :prompt => t(:select_a_client) })
  50.  
  51. .work_unit_field
  52. %label{:for => "work_unit_project_id"}= "#{t(:project)}:"
  53. = collection_select("work_unit", "project_id", @projects, "id", "name", { :prompt => t(:select_a_project) })
  54.  
  55. .work_unit_field
  56. %label{:for => "work_unit_ticket_id"}= "#{t(:ticket)}:"
  57. = collection_select("work_unit", "ticket_id", @tickets, "id", "name", { :prompt => t(:select_a_ticket) })
  58.  
  59. .work_unit_field
  60. %label{:for => "work_unit_hours_type"}= "#{t(:type)}:"
  61. = select_tag("hours_type", options_for_select(['Normal', 'Overtime', 'CTO', 'PTO']))
  62.  
  63. .work_unit_field
  64. %label{:for => "work_unit_hours"}= "#{t(:hours).capitalize}:"
  65. = f.text_field :hours, { :size => 10 }
  66.  
  67. .work_unit_field
  68. %label{:for => "work_unit_description"}= "#{t(:description)}:"
  69. = f.text_area :description, { :rows => 10, :style => "resize: none;"}
  70.  
  71. .work_unit_field
  72. = f.hidden_field :scheduled_at, :value => Date.current
  73. = f.submit t(:create_work_unit), :class => 'add_new_button'
Add Comment
Please, Sign In to add comment