diff --git a/app/views/projects/done.html.erb b/app/views/projects/done.html.erb index 6bea10b4..66e199f2 100644 --- a/app/views/projects/done.html.erb +++ b/app/views/projects/done.html.erb @@ -12,7 +12,7 @@
> - <%= will_paginate @projects, paginate_options %> +
<%= will_paginate @projects, paginate_options %>

<%= "#{@total} (#{@range_low}-#{@range_high})" %> <%= t('states.completed_plural' )%> <%= t('common.projects') %> @@ -21,7 +21,7 @@ <%= render :partial => 'project_listing', :collection => @projects %>

- <%= will_paginate @projects, paginate_options %> +
diff --git a/app/views/recurring_todos/done.html.erb b/app/views/recurring_todos/done.html.erb index 7835030a..cdec0fc2 100644 --- a/app/views/recurring_todos/done.html.erb +++ b/app/views/recurring_todos/done.html.erb @@ -8,7 +8,7 @@ %>
- <%= will_paginate @completed_recurring_todos, paginate_options %> +
<%= will_paginate @completed_recurring_todos, paginate_options %>

<%= "#{@total} (#{@range_low}-#{@range_high})" %> <%= t('todos.completed_recurring') %> @@ -19,6 +19,6 @@

<%= render :partial => @completed_recurring_todos %>
- <%= will_paginate @completed_recurring_todos, paginate_options %> +
\ No newline at end of file diff --git a/app/views/todos/all_done.html.erb b/app/views/todos/all_done.html.erb index 5ecc4572..d55c05c1 100644 --- a/app/views/todos/all_done.html.erb +++ b/app/views/todos/all_done.html.erb @@ -8,7 +8,7 @@ %>
- <%= will_paginate @done, paginate_options %> +
<%= will_paginate @done, paginate_options %>

<%= t('todos.all_completed') %>

<% if @done.empty? -%>

<%= t('todos.no_completed_actions') %>

@@ -17,6 +17,6 @@ <% end -%>
- <%= will_paginate @done, paginate_options %> +
diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb index d9391daf..be48a527 100644 --- a/features/step_definitions/todo_create_steps.rb +++ b/features/step_definitions/todo_create_steps.rb @@ -188,7 +188,9 @@ end ####### submitting using sidebar form ####### When /^I submit a new action with description "([^"]*)"$/ do |description| - fill_in "todo[description]", :with => description + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => description + end submit_next_action_form end @@ -196,16 +198,16 @@ When /^I submit a new action with description "([^"]*)" with a dependency on "([ predecessor = @current_user.todos.find_by_description(predecessor_description) predecessor.should_not be_nil - fill_in "todo[description]", :with => todo_description - fill_in "predecessor_input", :with => predecessor_description + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => todo_description + fill_in "predecessor_input", :with => predecessor_description + end - # wait for auto complete - autocomplete = "//a[@id='ui-active-menuitem']" - page.should have_xpath(autocomplete, :visible => true) + # wait for auto complete + page.should have_css("a.ui-state-focus", :visible => true) # click first line - first_elem = "//ul/li[1]/a[@id='ui-active-menuitem']" - page.find(:xpath, first_elem).click + page.find(:css, "ul li a.ui-state-focus").click new_dependency_line = "//li[@id='pred_#{predecessor.id}']" page.should have_xpath(new_dependency_line, :visible => true) @@ -214,24 +216,28 @@ When /^I submit a new action with description "([^"]*)" with a dependency on "([ end When /^I submit a new action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name| - fill_in "todo[description]", :with => description - fill_in "tag_list", :with => tags + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => description + fill_in "tag_list", :with => tags - # fill_in does not seem to work when the field is prefilled with something. Empty the field first - clear_context_name_from_next_action_form - fill_in "todo_context_name", :with => context_name + # fill_in does not seem to work when the field is prefilled with something. Empty the field first + clear_context_name_from_next_action_form + fill_in "todo_context_name", :with => context_name + end submit_next_action_form end When /^I submit a new action with description "([^"]*)" to project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, tags, context_name| - fill_in "todo[description]", :with => description + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => description - clear_project_name_from_next_action_form - clear_context_name_from_next_action_form + clear_project_name_from_next_action_form + clear_context_name_from_next_action_form - fill_in "todo_project_name", :with => project_name - fill_in "todo_context_name", :with => context_name - fill_in "tag_list", :with => tags + fill_in "todo_project_name", :with => project_name + fill_in "todo_context_name", :with => context_name + fill_in "tag_list", :with => tags + end submit_next_action_form end @@ -241,10 +247,12 @@ When /^I submit a new action with description "([^"]*)" to project "([^"]*)" in end When /^I submit a new action with description "([^"]*)" in the context "([^"]*)"$/ do |description, context_name| - fill_in "todo[description]", :with => description + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => description - clear_context_name_from_next_action_form - fill_in "todo_context_name", :with => context_name + clear_context_name_from_next_action_form + fill_in "todo_context_name", :with => context_name + end submit_next_action_form end @@ -258,13 +266,15 @@ When /^I submit a new deferred action with description "([^"]*)"$/ do |descripti end When /^I submit a new deferred action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name| - fill_in "todo[description]", :with => description + within "form#todo-form-new-action" do + fill_in "todo[description]", :with => description - clear_context_name_from_next_action_form - fill_in "todo_context_name", :with => context_name + clear_context_name_from_next_action_form + fill_in "todo_context_name", :with => context_name - fill_in "tag_list", :with => tags - fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week) + fill_in "tag_list", :with => tags + fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week) + end submit_next_action_form end @@ -274,10 +284,12 @@ When /^I submit a new deferred action with description "([^"]*)" to project "([^ clear_project_name_from_next_action_form clear_context_name_from_next_action_form - fill_in "todo_project_name", :with => project_name - fill_in "todo_context_name", :with => context_name - fill_in "tag_list", :with => tags - fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week) + within "form#todo-form-new-action" do + fill_in "todo_project_name", :with => project_name + fill_in "todo_context_name", :with => context_name + fill_in "tag_list", :with => tags + fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week) + end submit_next_action_form end diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb index aa0c5cf9..dcf5253e 100644 --- a/features/step_definitions/todo_steps.rb +++ b/features/step_definitions/todo_steps.rb @@ -1,3 +1,7 @@ +When /^I select the second page$/ do + step "I follow \"2\" within \"div.paginate_header\"" +end + ####### DELETE ####### When /^I delete the action "([^"]*)"$/ do |action_description| @@ -108,7 +112,7 @@ Then /^I should see the page selector$/ do end Then /^the page should be "([^"]*)"$/ do |page_number| - page.find(:xpath, ".//em[@class='current']").text.should == page_number + page.find(:xpath, ".//div[@class='paginate_header']//em[@class='current']").text.should == page_number end Then /^the project field of the new todo form should contain "([^"]*)"$/ do |project_name| diff --git a/features/view_done.feature b/features/view_done.feature index 863f9f89..6b0e50bd 100644 --- a/features/view_done.feature +++ b/features/view_done.feature @@ -63,7 +63,7 @@ Feature: Show done Given I have 50 completed todos with a note in project "test project" in context "@pc" with tags "starred" When I go to the Then I should see the page selector - When I follow "2" + When I select the second page Then I should be on the And the page should be "2" diff --git a/lib/tasks/continuous_integration.rake b/lib/tasks/continuous_integration.rake index 93dba4de..67b5f161 100644 --- a/lib/tasks/continuous_integration.rake +++ b/lib/tasks/continuous_integration.rake @@ -1 +1 @@ -task :ci => ['db:migrate', :test] +task :ci => ['db:migrate', :test, :cucumber]