mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
fix failing tests
This commit is contained in:
parent
07de6a8358
commit
7084c11263
12 changed files with 61 additions and 45 deletions
|
|
@ -512,18 +512,18 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_needs_to_hide_container
|
def update_needs_to_hide_container
|
||||||
if source_view_is(:tag)
|
if source_view_is_one_of(:tag, :context, :project)
|
||||||
return @remaining_in_context == 0 && (
|
return @remaining_in_context == 0 && (
|
||||||
todo_moved_out_of_container ||
|
todo_moved_out_of_container ||
|
||||||
(@todo_hidden_state_changed && @todo.hidden?) ||
|
(@todo_hidden_state_changed && @todo.hidden?) ||
|
||||||
@todo_was_deferred_from_active_state ||
|
@todo_was_deferred_from_active_state ||
|
||||||
@tag_was_removed ||
|
@tag_was_removed ||
|
||||||
@todo_was_destroyed ||
|
@todo_was_destroyed ||
|
||||||
(@todo.completed? && !(@original_item_was_deferred || @original_item_was_hidden))
|
(@todo.completed? && !(@original_item_was_deferred || @original_item_was_hidden || @original_item_was_pending))
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
return false if source_view_is_one_of(:project, :calendar, :done, :context)
|
return false if source_view_is_one_of(:calendar, :done)
|
||||||
|
|
||||||
return @remaining_in_context == 0
|
return @remaining_in_context == 0
|
||||||
end
|
end
|
||||||
|
|
@ -599,7 +599,7 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def todo_container_empty_id(todo)
|
def todo_container_empty_id(todo)
|
||||||
raise Exception.new, "no todo set in TodosHelper::todo_container_empty_id. You probably not assign @original_item" if !todo
|
raise Exception.new, "no todo set in TodosHelper::todo_container_empty_id. You probably did not assign @original_item" if !todo
|
||||||
@group_view_by == "project" ? project_container_empty_id(todo) : context_container_empty_id(todo)
|
@group_view_by == "project" ? project_container_empty_id(todo) : context_container_empty_id(todo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -609,8 +609,7 @@ module TodosHelper
|
||||||
return "#{@new_due_id}_container" if source_view_is :calendar
|
return "#{@new_due_id}_container" if source_view_is :calendar
|
||||||
return "deferred_pending_container" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
return "deferred_pending_container" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
||||||
return "completed_container" if todo.completed?
|
return "completed_container" if todo.completed?
|
||||||
return "p#{todo.project_id}" if source_view_is :project
|
return project_container_id(todo) if source_view_is_one_of(:todo, :tag, :project, :context) && @group_view_by == 'project'
|
||||||
return project_container_id(todo) if source_view_is_one_of(:todo, :tag) && @group_view_by == 'project'
|
|
||||||
return context_container_id(todo)
|
return context_container_id(todo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -620,7 +619,7 @@ module TodosHelper
|
||||||
source_view do |page|
|
source_view do |page|
|
||||||
page.project {
|
page.project {
|
||||||
return "deferred_pending_container-empty-d" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return project_container_empty_id(todo)
|
return todo_container_empty_id(todo)
|
||||||
}
|
}
|
||||||
page.tag {
|
page.tag {
|
||||||
return "deferred_pending_container-empty-d" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
|
|
@ -633,7 +632,7 @@ module TodosHelper
|
||||||
}
|
}
|
||||||
page.context {
|
page.context {
|
||||||
return "deferred_pending_container-empty-d" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return context_container_empty_id(todo)
|
return todo_container_empty_id(todo)
|
||||||
}
|
}
|
||||||
page.todo {
|
page.todo {
|
||||||
return todo_container_empty_id(todo)
|
return todo_container_empty_id(todo)
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,14 @@
|
||||||
show_empty_containers = (@group_view_by == 'context')
|
show_empty_containers = (@group_view_by == 'context')
|
||||||
-%>
|
-%>
|
||||||
<div id="display_box">
|
<div id="display_box">
|
||||||
|
|
||||||
|
<%= empty_message_holder("not_done_project", @not_done_todos.empty?) %>
|
||||||
|
|
||||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'context'}) %>
|
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'context'}) %>
|
||||||
<% if @group_view_by == 'project' -%>
|
|
||||||
<%= show_todos_without_project(@todos_without_project, {:collapsible => false, :parent_container_type => 'context', :title_param => @context.name}) -%>
|
<% if @group_view_by == 'project' -%>
|
||||||
<% end -%>
|
<%= show_todos_without_project(@todos_without_project, {:collapsible => false, :parent_container_type => 'context', :title_param => @context.name}) -%>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,15 @@
|
||||||
# force project view so one empty container will be shown with an empty message
|
# force project view so one empty container will be shown with an empty message
|
||||||
@group_view_by = 'project'
|
@group_view_by = 'project'
|
||||||
end
|
end
|
||||||
show_empty_containers = (@group_view_by == 'project')
|
|
||||||
-%>
|
-%>
|
||||||
<div id="display_box">
|
<div id="display_box">
|
||||||
<%= project_next_prev %>
|
<%= project_next_prev %>
|
||||||
|
|
||||||
<%= render :partial => "project_settings_container", :locals => {:project => @project} %>
|
<%= render :partial => "project_settings_container", :locals => {:project => @project} %>
|
||||||
|
|
||||||
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => show_empty_containers, :parent_container_type => 'project' }) %>
|
<%= empty_message_holder("not_done_context", @not_done_todos.empty?) %>
|
||||||
|
|
||||||
|
<%= show_grouped_todos({:collapsible => false, :show_empty_containers => false, :parent_container_type => 'project' }) %>
|
||||||
|
|
||||||
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
animation << "add_todo_to_container" unless source_view_is(:done)
|
animation << "add_todo_to_container" unless source_view_is(:done)
|
||||||
animation << "block_predecessors"
|
animation << "block_predecessors"
|
||||||
end
|
end
|
||||||
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred)
|
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred, :project, :context)
|
||||||
animation << "regenerate_predecessor_family"
|
animation << "regenerate_predecessor_family"
|
||||||
else
|
else
|
||||||
animation << "replace_todo"
|
animation << "replace_todo"
|
||||||
|
|
@ -63,15 +63,14 @@ function replace_todo(next_steps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_todo_to_container(next_steps) {
|
function add_todo_to_container(next_steps) {
|
||||||
// <%= @group_view_by %>
|
|
||||||
$('#<%= item_container_id(@todo) %>_items').append(html_for_todo());
|
$('#<%= item_container_id(@todo) %>_items').append(html_for_todo());
|
||||||
<% if should_make_context_visible -%>
|
<% if should_make_context_visible -%>
|
||||||
$('#<%= item_container_id(@todo) %>').slideDown(500, function() {
|
$('#<%= item_container_id(@todo) %>').slideDown(500, function() {
|
||||||
$("#<%= empty_container_msg_div_id %>").slideUp(100);
|
$("#<%= empty_container_msg_div_id %>").slideUp(100);
|
||||||
highlight_updated_todo(next_steps);
|
highlight_updated_todo(next_steps);
|
||||||
});
|
});
|
||||||
<% else -%>
|
<% else -%>
|
||||||
$("#<%= empty_container_msg_div_id(@todo) %>").slideUp(100);
|
$("#<%= empty_container_msg_div_id(@todo) %>").slideUp(100);
|
||||||
highlight_updated_todo(next_steps);
|
highlight_updated_todo(next_steps);
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @completed_count == 0 -%>
|
<% if @completed_count == 0 -%>
|
||||||
|
|
@ -120,7 +119,7 @@ function highlight_updated_todo(next_steps) {
|
||||||
|
|
||||||
function activate_pending_todos(next_steps) {
|
function activate_pending_todos(next_steps) {
|
||||||
<% # Activate pending todos that are successors of the completed
|
<% # Activate pending todos that are successors of the completed
|
||||||
if @saved && @pending_to_activate
|
if @pending_to_activate
|
||||||
# do not render the js in case of an error or if no todos to activate
|
# do not render the js in case of an error or if no todos to activate
|
||||||
@pending_to_activate.each do |t|
|
@pending_to_activate.each do |t|
|
||||||
html = escape_javascript(render(:partial => t, :locals => { :parent_container_type => parent_container_type }))
|
html = escape_javascript(render(:partial => t, :locals => { :parent_container_type => parent_container_type }))
|
||||||
|
|
@ -173,7 +172,7 @@ end
|
||||||
|
|
||||||
function html_for_recurring_todo() {
|
function html_for_recurring_todo() {
|
||||||
<%-
|
<%-
|
||||||
js = @saved && @new_recurring_todo ? escape_javascript(render(:partial => @new_recurring_todo, :locals => { :parent_container_type => parent_container_type })) : ""
|
js = @new_recurring_todo ? escape_javascript(render(:partial => @new_recurring_todo, :locals => { :parent_container_type => parent_container_type })) : ""
|
||||||
-%>
|
-%>
|
||||||
return "<%= js %>";
|
return "<%= js %>";
|
||||||
}
|
}
|
||||||
|
|
@ -181,7 +180,7 @@ function html_for_recurring_todo() {
|
||||||
function html_for_todo() {
|
function html_for_todo() {
|
||||||
<%-
|
<%-
|
||||||
js = ""
|
js = ""
|
||||||
if @saved && !source_view_is(:done)
|
if !source_view_is(:done)
|
||||||
js = escape_javascript(render(
|
js = escape_javascript(render(
|
||||||
:partial => @todo,
|
:partial => @todo,
|
||||||
:locals => {
|
:locals => {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
end
|
end
|
||||||
animation << "hide_container" if update_needs_to_hide_container
|
animation << "hide_container" if update_needs_to_hide_container
|
||||||
animation << "highlight_updated_todo"
|
animation << "highlight_updated_todo"
|
||||||
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred)
|
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred, :project, :context)
|
||||||
animation << "update_predecessors"
|
animation << "update_predecessors"
|
||||||
%>
|
%>
|
||||||
TracksPages.page_notify('notice', '<%=escape_javascript @status_message%>', 5);
|
TracksPages.page_notify('notice', '<%=escape_javascript @status_message%>', 5);
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,8 @@ en:
|
||||||
completed: Currently there are no completed actions
|
completed: Currently there are no completed actions
|
||||||
title: No actions found
|
title: No actions found
|
||||||
not_done_with_tag: "Currently there are no incomplete actions with the tag '%{param}'"
|
not_done_with_tag: "Currently there are no incomplete actions with the tag '%{param}'"
|
||||||
|
not_done_project: Currently there are no incomplete actions in this project
|
||||||
|
not_done_context: Currently there are no incomplete actions in this context
|
||||||
completed_recurring: Currently there are no completed recurring todos
|
completed_recurring: Currently there are no completed recurring todos
|
||||||
not_done: Currently there are no incomplete actions
|
not_done: Currently there are no incomplete actions
|
||||||
project: Currently there are no incomplete actions in this project
|
project: Currently there are no incomplete actions in this project
|
||||||
|
|
|
||||||
|
|
@ -68,10 +68,10 @@ Feature: dependencies
|
||||||
And "test 2" depends on "test 1"
|
And "test 2" depends on "test 1"
|
||||||
When I go to the "dependencies" project
|
When I go to the "dependencies" project
|
||||||
Then I should see "test 2" in the deferred container
|
Then I should see "test 2" in the deferred container
|
||||||
And I should see "test 1" in the action container
|
And I should see "test 1" in the context container for "@pc"
|
||||||
When I mark "test 1" as complete
|
When I mark "test 1" as complete
|
||||||
Then I should see "test 1" in the completed container
|
Then I should see "test 1" in the completed container
|
||||||
And I should see "test 2" in the action container
|
And I should see "test 2" in the context container for "@pc"
|
||||||
And I should not see "test 2" in the deferred container
|
And I should not see "test 2" in the deferred container
|
||||||
And I should see empty message for deferred todos of project
|
And I should see empty message for deferred todos of project
|
||||||
|
|
||||||
|
|
@ -86,9 +86,9 @@ Feature: dependencies
|
||||||
And "test 2" depends on "test 1"
|
And "test 2" depends on "test 1"
|
||||||
When I go to the "dependencies" project
|
When I go to the "dependencies" project
|
||||||
Then I should see "test 2" in the deferred container
|
Then I should see "test 2" in the deferred container
|
||||||
And I should see "test 1" in the action container
|
And I should see "test 1" in the context container for "@pc"
|
||||||
When I delete the action "test 1"
|
When I delete the action "test 1"
|
||||||
Then I should see "test 2" in the action container
|
Then I should see "test 2" in the context container for "@pc"
|
||||||
And I should not see "test 2" in the deferred container
|
And I should not see "test 2" in the deferred container
|
||||||
And I should see empty message for deferred todos of project
|
And I should see empty message for deferred todos of project
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@ Feature: dependencies
|
||||||
Then I should see "test 3" within the dependencies of "test 1"
|
Then I should see "test 3" within the dependencies of "test 1"
|
||||||
And I should not see "test 2"
|
And I should not see "test 2"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Dragging an action to a completed action will not add it as a dependency
|
Scenario: Dragging an action to a completed action will not add it as a dependency
|
||||||
Given I have a context called "@pc"
|
Given I have a context called "@pc"
|
||||||
And I have a project "dependencies" that has the following todos
|
And I have a project "dependencies" that has the following todos
|
||||||
|
|
@ -122,7 +122,7 @@ Feature: dependencies
|
||||||
When I go to the "dependencies" project
|
When I go to the "dependencies" project
|
||||||
And I drag "test 1" to "test 3"
|
And I drag "test 1" to "test 3"
|
||||||
Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!"
|
Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!"
|
||||||
And I should see "test 1" in the project container of "dependencies"
|
And I should see "test 1" in the context container for "@pc"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: Marking a successor as complete will update predecessor
|
Scenario Outline: Marking a successor as complete will update predecessor
|
||||||
|
|
@ -148,7 +148,7 @@ Feature: dependencies
|
||||||
| tag page for "bla" | context |
|
| tag page for "bla" | context |
|
||||||
| tag page for "bla" | project |
|
| tag page for "bla" | project |
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: Marking a successor as active will update predecessor
|
Scenario Outline: Marking a successor as active will update predecessor
|
||||||
Given I have a context called "@pc"
|
Given I have a context called "@pc"
|
||||||
And I have selected the view for group by <grouping>
|
And I have selected the view for group by <grouping>
|
||||||
|
|
@ -171,5 +171,6 @@ Feature: dependencies
|
||||||
Scenarios:
|
Scenarios:
|
||||||
| page | grouping |
|
| page | grouping |
|
||||||
| "dependencies" project | project |
|
| "dependencies" project | project |
|
||||||
|
| "dependencies" project | context |
|
||||||
| tag page for "bla" | context |
|
| tag page for "bla" | context |
|
||||||
| tag page for "bla" | project |
|
| tag page for "bla" | project |
|
||||||
|
|
@ -55,7 +55,7 @@ Feature: Edit a next action from every page
|
||||||
@javascript @wip
|
@javascript @wip
|
||||||
Scenario Outline: Changing container of the todo in that container will hide it
|
Scenario Outline: Changing container of the todo in that container will hide it
|
||||||
# this script fails on https://code.google.com/p/selenium/issues/detail?id=3075 for selenium-webdriver > 2.14.
|
# this script fails on https://code.google.com/p/selenium/issues/detail?id=3075 for selenium-webdriver > 2.14.
|
||||||
# and selenium-webdriver < 2.20 fails on firefox 11 :-( So @wip for now. This may work on webkit though
|
# and selenium-webdriver < 2.20 fails on firefox 11 :-( So @wip for now. This may work with webkit though
|
||||||
Given I have a todo "delete me" in the context "@home" in the project "do it"
|
Given I have a todo "delete me" in the context "@home" in the project "do it"
|
||||||
And I have a project "go for it"
|
And I have a project "go for it"
|
||||||
And I have selected the view for group by <grouping>
|
And I have selected the view for group by <grouping>
|
||||||
|
|
@ -77,6 +77,7 @@ Feature: Edit a next action from every page
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: Deleting the last todo in container will show empty message # only project, context, tag, not todo
|
Scenario Outline: Deleting the last todo in container will show empty message # only project, context, tag, not todo
|
||||||
Given I have a context called "@home"
|
Given I have a context called "@home"
|
||||||
|
And I have selected the view for group by <grouping>
|
||||||
And I have a project "my project" that has the following todos
|
And I have a project "my project" that has the following todos
|
||||||
| context | description | tags |
|
| context | description | tags |
|
||||||
| @home | first action | test, bla |
|
| @home | first action | test, bla |
|
||||||
|
|
@ -90,12 +91,15 @@ Feature: Edit a next action from every page
|
||||||
Then I should see empty message for todos of <page type>
|
Then I should see empty message for todos of <page type>
|
||||||
|
|
||||||
Scenarios:
|
Scenarios:
|
||||||
| page | page type |
|
| page | page type | grouping |
|
||||||
| "my project" project | project |
|
| "my project" project | project | project |
|
||||||
| context page for "@home" | context |
|
| "my project" project | project | context |
|
||||||
| tag page for "bla" | tag |
|
| context page for "@home" | context | context |
|
||||||
|
| context page for "@home" | context | project |
|
||||||
|
| tag page for "bla" | tag | context |
|
||||||
|
| tag page for "bla" | tag | project |
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: I can mark an active todo complete and it will update empty messages
|
Scenario Outline: I can mark an active todo complete and it will update empty messages
|
||||||
Given I have a context called "visible context"
|
Given I have a context called "visible context"
|
||||||
And I have a project called "visible project"
|
And I have a project called "visible project"
|
||||||
|
|
@ -134,7 +138,7 @@ Feature: Edit a next action from every page
|
||||||
| "visible project" project | project |
|
| "visible project" project | project |
|
||||||
| context page for "visible context" | context |
|
| context page for "visible context" | context |
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: I can mark a completed todo active and it will update empty messages and context containers
|
Scenario Outline: I can mark a completed todo active and it will update empty messages and context containers
|
||||||
Given I have a completed todo with description "visible todo" in project "visible project" with tags "starred" in the context "visible context"
|
Given I have a completed todo with description "visible todo" in project "visible project" with tags "starred" in the context "visible context"
|
||||||
And I have selected the view for group by <grouping>
|
And I have selected the view for group by <grouping>
|
||||||
|
|
@ -155,8 +159,8 @@ Feature: Edit a next action from every page
|
||||||
| home page | home | context | container for context "visible context" |
|
| home page | home | context | container for context "visible context" |
|
||||||
| home page | home | project | container for project "visible project" |
|
| home page | home | project | container for project "visible project" |
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: I can mark a completed todo active and it will update empty messages for pages without context containers
|
Scenario Outline: I can mark a completed todo active and it will update empty messages for pages without hideable containers
|
||||||
Given I have a completed todo with description "visible todo" in project "visible project" with tags "starred" in the context "visible context"
|
Given I have a completed todo with description "visible todo" in project "visible project" with tags "starred" in the context "visible context"
|
||||||
When I go to the <page>
|
When I go to the <page>
|
||||||
Then I should see empty message for todos of <page type>
|
Then I should see empty message for todos of <page type>
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ Feature: Edit a project
|
||||||
Scenario: Moving the todo to the tickler will move todo to tickler container and update empty messages
|
Scenario: Moving the todo to the tickler will move todo to tickler container and update empty messages
|
||||||
Given I have a project "test" with 1 todos
|
Given I have a project "test" with 1 todos
|
||||||
When I go to the "test" project
|
When I go to the "test" project
|
||||||
Then I should see "todo 1" in the action container
|
Then I should see "todo 1" in the context container for "Context A"
|
||||||
And I should see empty message for deferred todos of project
|
And I should see empty message for deferred todos of project
|
||||||
And I should see empty message for completed todos of project
|
And I should see empty message for completed todos of project
|
||||||
When I defer "todo 1" for 1 day
|
When I defer "todo 1" for 1 day
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,9 @@ Feature: Add new next action from every page
|
||||||
| tickler page | context | not see |
|
| tickler page | context | not see |
|
||||||
| tickler page | project | not see |
|
| tickler page | project | not see |
|
||||||
| "test project" project | context | see |
|
| "test project" project | context | see |
|
||||||
|
| "test project" project | project | see |
|
||||||
| context page for "test context" | context | see |
|
| context page for "test context" | context | see |
|
||||||
|
| context page for "test context" | project | see |
|
||||||
| tag page for "starred" | context | see |
|
| tag page for "starred" | context | see |
|
||||||
| tag page for "starred" | project | see |
|
| tag page for "starred" | project | see |
|
||||||
|
|
||||||
|
|
@ -124,7 +126,9 @@ Feature: Add new next action from every page
|
||||||
| tickler page | not see | 0 | 3 | context |
|
| tickler page | not see | 0 | 3 | context |
|
||||||
| tickler page | not see | 0 | 3 | project |
|
| tickler page | not see | 0 | 3 | project |
|
||||||
| "testing" project | see | 3 | 3 | context |
|
| "testing" project | see | 3 | 3 | context |
|
||||||
|
| "testing" project | see | 3 | 3 | project |
|
||||||
| context page for "test context" | see | 2 | 3 | context |
|
| context page for "test context" | see | 2 | 3 | context |
|
||||||
|
| context page for "test context" | see | 2 | 3 | project |
|
||||||
| tag page for "starred" | see | 2 | 3 | context |
|
| tag page for "starred" | see | 2 | 3 | context |
|
||||||
| tag page for "starred" | see | 2 | 3 | project |
|
| tag page for "starred" | see | 2 | 3 | project |
|
||||||
|
|
||||||
|
|
@ -199,9 +203,13 @@ Feature: Add new next action from every page
|
||||||
| tickler page | context | not see | not see |
|
| tickler page | context | not see | not see |
|
||||||
| tickler page | project | not see | not see |
|
| tickler page | project | not see | not see |
|
||||||
| "visible project" project | project | not see | see |
|
| "visible project" project | project | not see | see |
|
||||||
|
| "visible project" project | context | not see | see |
|
||||||
| "hidden project" project | project | see | not see |
|
| "hidden project" project | project | see | not see |
|
||||||
|
| "hidden project" project | context | see | not see |
|
||||||
| context page for "visible context" | context | not see | see |
|
| context page for "visible context" | context | not see | see |
|
||||||
|
| context page for "visible context" | project | not see | see |
|
||||||
| context page for "other context" | context | not see | not see |
|
| context page for "other context" | context | not see | not see |
|
||||||
|
| context page for "other context" | project | not see | not see |
|
||||||
| tag page for "starred" | context | not see | not see |
|
| tag page for "starred" | context | not see | not see |
|
||||||
| tag page for "starred" | project | not see | not see |
|
| tag page for "starred" | project | not see | not see |
|
||||||
| tag page for "test" | context | see | see |
|
| tag page for "test" | context | see | see |
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ Then(/^I should (not see|see) "([^"]*)" in the (completed|done today|done this w
|
||||||
id = 'completed_rest_of_month_container' if container == 'done this month'
|
id = 'completed_rest_of_month_container' if container == 'done this month'
|
||||||
|
|
||||||
css = "div##{id} div#line_todo_#{find_todo(todo_description).id}"
|
css = "div##{id} div#line_todo_#{find_todo(todo_description).id}"
|
||||||
page.should have_css(css)
|
|
||||||
check_css_visibility(visible, css)
|
check_css_visibility(visible, css)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -138,9 +137,8 @@ end
|
||||||
|
|
||||||
Then /^I should (see|not see) empty message for (done today|done this week|done this month|completed todos|deferred todos|todos) (of done actions|of context|of project|of home|of tag)/ do |visible, state, type|
|
Then /^I should (see|not see) empty message for (done today|done this week|done this month|completed todos|deferred todos|todos) (of done actions|of context|of project|of home|of tag)/ do |visible, state, type|
|
||||||
css = "error: wrong state"
|
css = "error: wrong state"
|
||||||
css = "div#c#{@context.id}-empty-d" if state == "todos" && type == "of context"
|
css = "div#c#{@context.id}-empty-d" if state == "todos"
|
||||||
css = "div#p#{@project.id}-empty-d" if state == "todos" && type == "of project"
|
css = "div#no_todos_in_view" if state == "todos" && ["of home", "of tag", "of context", "of project"].include?(type)
|
||||||
css = "div#no_todos_in_view" if state == "todos" && (type == "of home" || type == "of tag")
|
|
||||||
css = "div#completed_today_container" if state == "done today"
|
css = "div#completed_today_container" if state == "done today"
|
||||||
css = "div#completed_rest_of_week_container" if state == "done this week"
|
css = "div#completed_rest_of_week_container" if state == "done this week"
|
||||||
css = "div#completed_rest_of_month_container" if state == "done this month"
|
css = "div#completed_rest_of_month_container" if state == "done this month"
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,9 @@ Given /^I have ([0-9]+) todos$/ do |count|
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^I have a todo with description "([^"]*)" in project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |action_description, project_name, tags, context_name|
|
Given /^I have a todo with description "([^"]*)" in project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |action_description, project_name, tags, context_name|
|
||||||
context = @current_user.contexts.where(:name => context_name).first_or_create
|
@context = @current_user.contexts.where(:name => context_name).first_or_create
|
||||||
project = @current_user.projects.where(:name => project_name).first_or_create
|
@project = @current_user.projects.where(:name => project_name).first_or_create
|
||||||
@todo = @current_user.todos.create!(:context_id => context.id, :project_id => project.id, :description => action_description)
|
@todo = @current_user.todos.create!(:context_id => @context.id, :project_id => @project.id, :description => action_description)
|
||||||
@todo.tag_with(tags)
|
@todo.tag_with(tags)
|
||||||
@todo.save
|
@todo.save
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue