diff --git a/app/views/layouts/mobile.m.erb b/app/views/layouts/mobile.m.erb
index 79836850..ab8ff179 100644
--- a/app/views/layouts/mobile.m.erb
+++ b/app/views/layouts/mobile.m.erb
@@ -13,7 +13,7 @@
<% if !(@new_mobile || @edit_mobile)
if current_user && !current_user.prefs.nil? -%>
-<%= @down_count %> <%=
+<%= @down_count %> <%=
l(Date.today, :format => current_user.prefs.title_date_format) -%>
<%= (link_to(t('layouts.mobile_navigation.new_action'), new_todo_path(new_todo_params))+" | ") unless @new_mobile -%>
diff --git a/features/mobile_add_action.feature b/features/mobile_add_action.feature
index bb1429bd..80d9939d 100644
--- a/features/mobile_add_action.feature
+++ b/features/mobile_add_action.feature
@@ -19,9 +19,18 @@ Feature: Add new next action from mobile page
And the selected context should be ""
Scenarios: # empty means no selected, i.e. first in list is shown
- | page | project | context |
- | home page | | |
- | tickler page | | |
- | "test project" project | test project | |
- | context page for "test context" | | test context |
- | tag page for "starred" | | |
\ No newline at end of file
+ | page | project | context |
+ | home page | | |
+ | tickler page | | |
+ | "test project" project | test project | |
+ | context page for "test context" | | test context |
+ | tag page for "starred" | | |
+
+ Scenario: I can add a new todo using the mobile interface
+ Given I am on the home page
+ Then the badge should show 0
+ When I follow "0-New action"
+ And I fill in "Description" with "test me"
+ And I press "Create"
+ Then I should see "test me"
+ And the badge should show 1
diff --git a/features/mobile_context_list.feature b/features/mobile_context_list.feature
new file mode 100644
index 00000000..769c10b7
--- /dev/null
+++ b/features/mobile_context_list.feature
@@ -0,0 +1,23 @@
+Feature: View the list of contexts from mobile
+ In order to be able to see all contexts from the mobile interface
+ As a Tracks user
+ I want to to be able to see a list of project
+
+ Background:
+ Given the following user record
+ | login | password | is_admin |
+ | testuser | secret | false |
+ And I am working on the mobile interface
+ And I have logged in as "testuser" with password "secret"
+ And I have a context called "@mobile"
+ And I have a project "test project" that has the following todos
+ | context | description |
+ | @mobile | test action |
+
+ Scenario: I can go to a context from the mobile context list page
+ Given I have a todo "test mobile page" in the context "@mobile"
+ And I am on the contexts page
+ Then I should see "@mobile"
+ When I follow "@mobile"
+ Then the badge should show 2
+ And I should see "@mobile"
diff --git a/features/mobile_edit_a_todo.feature b/features/mobile_edit_a_todo.feature
new file mode 100644
index 00000000..62b8ad77
--- /dev/null
+++ b/features/mobile_edit_a_todo.feature
@@ -0,0 +1,38 @@
+Feature: Edit a next action from the mobile view
+ In order to manage a next action
+ As a Tracks user
+ I want to to be able to edit a next action
+
+ Background:
+ Given the following user record
+ | login | password | is_admin |
+ | testuser | secret | false |
+ And I am working on the mobile interface
+ And I have logged in as "testuser" with password "secret"
+ And I have a context called "@mobile"
+ And I have a project "test project" that has the following todos
+ | context | description |
+ | @mobile | test action |
+
+ Scenario: I can edit an action on the mobile page
+ When I am on the home page
+ Then the badge should show 1
+ Then I should see "test action"
+ When I follow "test action"
+ And I fill in "Description" with "changed action"
+ And I press "Update"
+ Then I should see "changed action"
+ And I should not see "test action"
+ When I follow "changed action"
+ And I check "done"
+ And I press "Update"
+ Then I should not see "changed action"
+
+ Scenario: Navigate from home page
+ move this to separate features when other scenarios are created for these features
+ When I am on the home page
+ Then the badge should show 1
+ When I follow "Tickler"
+ Then the badge should show 0
+ When I follow "Feeds"
+ Then I should see "Last 15 actions"
diff --git a/features/mobile_project_list.feature b/features/mobile_project_list.feature
new file mode 100644
index 00000000..35402a49
--- /dev/null
+++ b/features/mobile_project_list.feature
@@ -0,0 +1,22 @@
+Feature: View the list of projects from mobile
+ In order to be able to see all project from the mobile interface
+ As a Tracks user
+ I want to to be able to see a list of project
+
+ Background:
+ Given the following user record
+ | login | password | is_admin |
+ | testuser | secret | false |
+ And I am working on the mobile interface
+ And I have logged in as "testuser" with password "secret"
+ And I have a context called "@mobile"
+ And I have a project "test project" that has the following todos
+ | context | description |
+ | @mobile | test action |
+
+ Scenario: I can go to a project from the list of project in mobile view
+ Given I am on the projects page
+ Then I should see "test project"
+ When I follow "test project"
+ Then the badge should show 1
+ And I should see "test action"
diff --git a/features/mobile_tagging_todos.feature b/features/mobile_tagging_todos.feature
new file mode 100644
index 00000000..c12ffbb8
--- /dev/null
+++ b/features/mobile_tagging_todos.feature
@@ -0,0 +1,24 @@
+Feature: Show the actions that are tagged on the mobile page
+ In order to be able to see all actions tags with a certain tag
+ As a Tracks user
+ I want to to be able to find all actions with a specific tag
+
+ Background:
+ Given the following user record
+ | login | password | is_admin |
+ | testuser | secret | false |
+ And I am working on the mobile interface
+ And I have logged in as "testuser" with password "secret"
+ And I have a context called "@mobile"
+ And I have a project "my project" that has the following todos
+ | context | description | tags |
+ | @mobile | first action | test, bla |
+ | @mobile | second action | bla |
+
+ Scenario: I can follow the tag of a action to see all actions belonging to that todo
+ When I go to the home page
+ And I follow "test"
+ Then the badge should show 1
+ When I go to the home page
+ And I follow "bla"
+ Then the badge should show 2
diff --git a/features/step_definitions/todo_steps.rb b/features/step_definitions/todo_steps.rb
index 8a15f620..0115c2c7 100644
--- a/features/step_definitions/todo_steps.rb
+++ b/features/step_definitions/todo_steps.rb
@@ -2,15 +2,18 @@ Given /^I have no todos$/ do
Todo.delete_all
end
-Given /^I have a todo "(.*)"$/ do |description|
- context = @current_user.contexts.create!(:name => "context A")
+Given /^I have a 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)
end
+Given /^I have a todo "([^"]*)"$/ do |description|
+ Given "I have a todo \"#{description}\" in the context \"Context A\""
+end
+
Given /^I have ([0-9]+) todos$/ do |count|
- context = @current_user.contexts.create!(:name => "context A")
count.to_i.downto 1 do |i|
- @current_user.todos.create!(:context_id => context.id, :description => "todo #{i}")
+ Given "I have a todo \"todo #{i}\" in the context \"Context A\""
end
end
@@ -55,12 +58,15 @@ Given /^I have a project "([^"]*)" that has the following todos$/ do |project_na
Given "I have a project called \"#{project_name}\""
@project.should_not be_nil
todos.hashes.each do |todo|
- context_id = @current_user.contexts.find_by_name(todo[:context])
- context_id.should_not be_nil
- @current_user.todos.create!(
+ context = @current_user.contexts.find_by_name(todo[:context])
+ context.should_not be_nil
+ new_todo = @current_user.todos.create!(
:description => todo[:description],
- :context_id => context_id,
+ :context_id => context.id,
:project_id=>@project.id)
+ unless todo[:tags].nil?
+ new_todo.tag_with(todo[:tags])
+ end
end
end
diff --git a/test/selenium/mobile/create_new_action.rsel b/test/selenium/mobile/create_new_action.rsel
deleted file mode 100644
index 7e6c2313..00000000
--- a/test/selenium/mobile/create_new_action.rsel
+++ /dev/null
@@ -1,18 +0,0 @@
-setup :fixtures => :all
-login :as => 'admin'
-
-open '/m'
-wait_for_text 'css=h1 span.count', '11'
-
-click_and_wait "link=0-New action"
-
-type "todo_notes", "test notes"
-type "todo_description", "test name"
-select "todo_context_id", "label=call"
-select "todo_project_id", "label=Make more money than Billy Gates"
-select "todo_due_3i", "label=1"
-select "todo_due_2i", "label=January"
-select "todo_due_1i", "label=2011"
-click_and_wait "//input[@value='Create']"
-
-wait_for_text 'css=h1 span.count', '12'
diff --git a/test/selenium/mobile/mark_done.rsel b/test/selenium/mobile/mark_done.rsel
deleted file mode 100644
index d6643973..00000000
--- a/test/selenium/mobile/mark_done.rsel
+++ /dev/null
@@ -1,13 +0,0 @@
-setup :fixtures => :all
-login :as => 'admin'
-
-open '/m'
-wait_for_text 'css=h1 span.count', '11'
-
-open '/todos/6.m'
-wait_for_page_to_load 3000
-
-click "done"
-click_and_wait "//input[@value='Update']"
-
-wait_for_text 'css=h1 span.count', '10'
diff --git a/test/selenium/mobile/navigation.rsel b/test/selenium/mobile/navigation.rsel
deleted file mode 100644
index 279fb5c6..00000000
--- a/test/selenium/mobile/navigation.rsel
+++ /dev/null
@@ -1,35 +0,0 @@
-setup :fixtures => :all
-login :as => 'admin'
-
-# open home page
-open '/m'
-wait_for_title "All actions"
-wait_for_text 'css=h1 span.count', '11'
-
-# open context page
-click_and_wait "link=2-Contexts"
-# verify_title "All actions in context agenda"
-# choose agenda context
-click_and_wait "link=agenda"
-wait_for_text 'css=h1 span.count', '6'
-
-# click on tag foo to go to tag page
-click_and_wait "link=foo"
-verify_title "TRACKS::Tagged with 'foo'"
-wait_for_text 'css=h1 span.count', '2'
-
-click_and_wait "link=3-Projects"
-wait_for_text 'css=h1 span.count', '3'
-click_and_wait "link=Build a working time machine"
-wait_for_text 'css=h1 span.count', '3'
-
-# follow link of action to edit form and mark done
-click_and_wait "link=Select Delorean model"
-click "done"
-click_and_wait "//input[@value='Update']"
-wait_for_text 'css=h1 span.count', '2'
-
-# just test the navigation.
-click_and_wait "link=Tickler"
-wait_for_text 'css=h1 span.count', '1'
-click_and_wait "link=Feeds"