mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 03:58:49 +01:00
fix failing test and finish all wip scenarios
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
f05826d07a
commit
3faac2514d
10 changed files with 95 additions and 17 deletions
|
|
@ -25,7 +25,11 @@ function clear_form() {
|
|||
}
|
||||
|
||||
function insert_new_context_with_new_todo() {
|
||||
$('#no_todos_in_view').slideUp(100);
|
||||
<%-
|
||||
empty_id = '#no_todos_in_view'
|
||||
empty_id = '#tickler-empty-nd' if source_view_is :tickler
|
||||
-%>
|
||||
$('<%=empty_id%>').slideUp(100);
|
||||
$('#display_box').prepend(html_for_new_context());
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +38,7 @@ function add_todo_to_existing_context() {
|
|||
<% unless source_view_is_one_of(:todo, :tag) && @todo.deferred? -%>
|
||||
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
|
||||
$('#no_todos_in_view').slideUp(100);
|
||||
<%= "$('#tickler-empty-nd').slideUp(100);" if source_view_is(:deferred) && @todo.deferred? %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
$('#<%=empty_container_msg_div_id%>').hide();
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ function replace_todo(next_steps) {
|
|||
function hide_context(next_steps) {
|
||||
<% context_id = @context_changed ? @original_item_context_id : @todo.context_id -%>
|
||||
$('#c<%= context_id %>').fadeOut(400, function(){ next_steps.go(); });
|
||||
<%= "$('#tickler-empty-nd').slideDown(400);" if source_view_is(:deferred) && @down_count == 0 %>
|
||||
}
|
||||
|
||||
function highlight_updated_todo(next_steps) {
|
||||
|
|
|
|||
|
|
@ -101,10 +101,10 @@ en:
|
|||
forth: Forth
|
||||
fourth: Fourth
|
||||
last: Last
|
||||
month: Month
|
||||
months: Months
|
||||
week: Week
|
||||
weeks: Weeks
|
||||
month: month
|
||||
months: months
|
||||
week: week
|
||||
weeks: weeks
|
||||
errors:
|
||||
user_unauthorized: "401 Unauthorized: Only administrative users are allowed access to this function."
|
||||
footer:
|
||||
|
|
@ -539,7 +539,7 @@ en:
|
|||
- tuesday
|
||||
- wednesday
|
||||
- thursday
|
||||
- vriday
|
||||
- friday
|
||||
- saturday
|
||||
month_names:
|
||||
-
|
||||
|
|
|
|||
|
|
@ -44,6 +44,23 @@ Then /^I should see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_
|
|||
selenium.is_visible(xpath).should be_true
|
||||
end
|
||||
|
||||
Then /^I should not see "([^"]*)" in the context container for "([^"]*)"$/ do |todo_description, context_name|
|
||||
context = @current_user.contexts.find_by_name(context_name)
|
||||
context.should_not be_nil
|
||||
todo = @current_user.todos.find_by_description(todo_description)
|
||||
todo.should_not be_nil
|
||||
|
||||
xpath = "xpath=//div[@id=\"c#{context.id}\"]//div[@id='line_todo_#{todo.id}']"
|
||||
|
||||
if selenium.is_element_present(xpath)
|
||||
# give jquery some time to finish
|
||||
wait_for :timeout_in_seconds => 5 do
|
||||
!selenium.is_visible(xpath)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_description, project_name|
|
||||
todo = @current_user.todos.find_by_description(todo_description)
|
||||
todo.should_not be_nil
|
||||
|
|
|
|||
|
|
@ -28,6 +28,18 @@ Then /^I should see the empty message in the deferred container$/ do
|
|||
end
|
||||
end
|
||||
|
||||
Then /^I should see the empty tickler message$/ do
|
||||
wait_for :timeout => 5 do
|
||||
selenium.is_visible("xpath=//div[@id='tickler-empty-nd']")
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should not see the empty tickler message$/ do
|
||||
wait_for :timeout => 5 do
|
||||
!selenium.is_visible("xpath=//div[@id='tickler-empty-nd']")
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should see an error flash message saying "([^"]*)"$/ do |message|
|
||||
xpath = "//div[@id='message_holder']/h4[@id='flash']"
|
||||
text = response.selenium.get_text("xpath=#{xpath}")
|
||||
|
|
|
|||
|
|
@ -42,6 +42,12 @@ When /^I submit a deferred new action with description "([^"]*)" to project "([^
|
|||
When "I submit a new deferred action with description \"#{description}\" to project \"#{project_name}\" with tags \"\" in the context \"#{context_name}\""
|
||||
end
|
||||
|
||||
When /^I submit a new deferred action with description "([^"]*)"$/ do |description|
|
||||
fill_in "todo[description]", :with => description
|
||||
fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -42,3 +42,13 @@ When /^I clear the due date of "([^"]*)"$/ do |action_description|
|
|||
selenium.click("//div[@id='edit_todo_#{todo.id}']//a[@id='due_x_todo_#{todo.id}']/img", :wait_for => :ajax, :javascript_framework => :jquery)
|
||||
submit_edit_todo_form(todo)
|
||||
end
|
||||
|
||||
When /^I remove the show from date from "([^"]*)"$/ do |action_description|
|
||||
todo = @current_user.todos.find_by_description(action_description)
|
||||
todo.should_not be_nil
|
||||
|
||||
open_edit_form_for(todo)
|
||||
selenium.click("//div[@id='edit_todo_#{todo.id}']//a[@id='show_from_x_todo_#{todo.id}']/img", :wait_for => :ajax, :javascript_framework => :jquery)
|
||||
|
||||
submit_edit_todo_form(todo)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -31,8 +31,12 @@ Given /^I have ([0-9]+) deferred todos$/ do |count|
|
|||
end
|
||||
end
|
||||
|
||||
Given /^I have a deferred todo "(.*)"$/ do |description|
|
||||
context = @current_user.contexts.create!(:name => "context B")
|
||||
Given /^I have a deferred todo "([^"]*)"$/ do |description|
|
||||
Given "I have a deferred todo \"#{description}\" in the context \"context B\""
|
||||
end
|
||||
|
||||
Given /^I have a deferred todo "([^"]*)" in the context "([^"]*)"$/ do |description, context_name|
|
||||
context = @current_user.contexts.find_or_create(:name => context_name)
|
||||
@current_user.todos.create!(:context_id => context.id, :description => description, :show_from => @current_user.time + 1.week)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -10,23 +10,46 @@ Feature: Manage deferred todos
|
|||
And there exists a project "manage me" for user "testuser"
|
||||
And I have logged in as "testuser" with password "secret"
|
||||
|
||||
@selenium @wip
|
||||
@selenium
|
||||
Scenario: I can add a deferred todo and it will show in the tickler
|
||||
# also adding the first deferred todo will hide the empty message
|
||||
When I go to the tickler
|
||||
Given I have a context called "test"
|
||||
When I go to the tickler page
|
||||
Then I should see the empty tickler message
|
||||
When I submit a deferred new action with description "a new next action"
|
||||
When I submit a new deferred action with description "a new next action"
|
||||
Then I should see "a new next action"
|
||||
And I should not see the empty tickler message
|
||||
|
||||
Scenario: Editing the description of a todo updated the todo
|
||||
Given this is a pending scenario
|
||||
@selenium
|
||||
Scenario: Editing the description of a todo in the tickler updated the todo
|
||||
Given I have a deferred todo "not yet now"
|
||||
When I go to the tickler page
|
||||
Then I should see "not yet now"
|
||||
When I edit the description of "not yet now" to "almost"
|
||||
Then I should not see "not yet now"
|
||||
And I should see "almost"
|
||||
|
||||
@selenium
|
||||
Scenario: Editing the context of a todo moves it to the new context
|
||||
Given this is a pending scenario
|
||||
Given I have a context called "A"
|
||||
And I have a context called "B"
|
||||
And I have a deferred todo "not yet now" in the context "A"
|
||||
When I go to the tickler page
|
||||
Then I should see "not yet now" in the context container for "A"
|
||||
When I edit the context of "not yet now" to "B"
|
||||
Then I should see "not yet now" in the context container for "B"
|
||||
And I should not see "not yet now" in the context container for "A"
|
||||
|
||||
@selenium
|
||||
Scenario: Removing the show from date from a todo removes it from the tickler
|
||||
Given this is a pending scenario
|
||||
Given I have a deferred todo "not yet now"
|
||||
When I go to the tickler page
|
||||
Then I should see "not yet now"
|
||||
When I remove the show from date from "not yet now"
|
||||
Then I should not see "not yet now"
|
||||
And I should see the empty tickler message
|
||||
When I go to the home page
|
||||
Then I should see "not yet now"
|
||||
|
||||
Scenario: Opening the tickler page shows me all deferred todos
|
||||
Given I have a deferred todo "not yet now"
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ class RecurringTodoTest < ActiveSupport::TestCase
|
|||
def test_pattern_text
|
||||
assert_equal "every day", @every_day.recurrence_pattern
|
||||
assert_equal "on work days", @every_workday.recurrence_pattern
|
||||
assert_equal "every last Friday of every 2 months", @monthly_every_last_friday.recurrence_pattern
|
||||
assert_equal "every year on June 8", @yearly.recurrence_pattern
|
||||
assert_equal "every last friday of every 2 months", @monthly_every_last_friday.recurrence_pattern
|
||||
assert_equal "every year on June 08", @yearly.recurrence_pattern
|
||||
end
|
||||
|
||||
def test_daily_every_day
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue