migrate login rjs to erb and reformat features

This commit is contained in:
Reinier Balt 2010-11-10 17:34:28 +01:00
parent 05b3b7cebc
commit 520e45fe6b
17 changed files with 137 additions and 152 deletions

View file

@ -0,0 +1 @@
window.location.href = '<%= login_path %>';

View file

@ -1 +0,0 @@
page.redirect_to :controller => 'login', :action => 'login'

View file

@ -0,0 +1,9 @@
<% if @session_expired
theHtml = content_tag(
:div,
t('login.session_time_out', :link => link_to(t('login.log_in_again'), :controller => "login", :action => "login")),
:"class" => "warning")
-%>
$('div#navcontainer').remove();
$('div#content').html('<%=theHtml%>');
<% end -%>

View file

@ -1,9 +0,0 @@
if @session_expired
page << "console.log('expired');"
page << "$('div#navcontainer').hide();"
page << "theHtml = \'<div class=\"warning\">" +
t('login.session_time_out', :link => link_to(
t('login.log_in_again'), :controller => "login", :action => "login"),
"class" => "warning")
page << "$('div#content').html(theHtml);"
end

View file

@ -1,5 +1,4 @@
Feature: Edit a context Feature: Edit a context
In order to work on todos in a context In order to work on todos in a context
As a Tracks user As a Tracks user
I want to manage todos in a context I want to manage todos in a context

View file

@ -1,5 +1,4 @@
Feature: Manage the list of contexts Feature: Manage the list of contexts
In order to keep track and manage all of my contexts In order to keep track and manage all of my contexts
As a Tracks user As a Tracks user
I want to manage my list of contexts I want to manage my list of contexts
@ -59,17 +58,17 @@ Feature: Manage the list of contexts
@selenium @selenium
Scenario Outline: Add a new context with state Scenario Outline: Add a new context with state
Given I have the following contexts Given I have the following contexts
| name | hide | | name | hide |
| @ipad | true | | @ipad | true |
| @home | false | | @home | false |
When I go to the contexts page When I go to the contexts page
And I add a new <state> context "<name>" And I add a new <state> context "<name>"
Then I should see the context "<name>" under "<state>" Then I should see the context "<name>" under "<state>"
Examples: Examples:
| state | name | | state | name |
| active | @phone | | active | @phone |
| hidden | @hidden| | hidden | @hidden |
@selenium @selenium
Scenario: Cannot add a context with comma in the name Scenario: Cannot add a context with comma in the name

View file

@ -1,5 +1,4 @@
Feature: Signup new users Feature: Signup new users
In order to be able to administer Tracks In order to be able to administer Tracks
As a user who just installed Tracks As a user who just installed Tracks
I want to create an admin account I want to create an admin account

View file

@ -1,5 +1,4 @@
Feature: dependencies Feature: dependencies
As a Tracks user As a Tracks user
In order to keep track of complex todos In order to keep track of complex todos
I want to assign and manage todo dependencies I want to assign and manage todo dependencies
@ -12,27 +11,27 @@ Feature: dependencies
@selenium @selenium
Scenario: Adding dependency to dependency Scenario: Adding dependency to dependency
Given I have a project "dependencies" with 3 todos Given I have a project "dependencies" with 3 todos
And "Todo 2" depends on "Todo 1" And "Todo 2" depends on "Todo 1"
When I visit the "dependencies" project When I visit the "dependencies" project
And I drag "Todo 3" to "Todo 2" And I drag "Todo 3" to "Todo 2"
Then the dependencies of "Todo 2" should include "Todo 1" Then the dependencies of "Todo 2" should include "Todo 1"
And the dependencies of "Todo 3" should include "Todo 2" And the dependencies of "Todo 3" should include "Todo 2"
When I expand the dependencies of "Todo 1" When I expand the dependencies of "Todo 1"
Then I should see "Todo 2" within the dependencies of "Todo 1" Then I should see "Todo 2" within the dependencies of "Todo 1"
And I should see "Todo 3" within the dependencies of "Todo 1" And I should see "Todo 3" within the dependencies of "Todo 1"
When I expand the dependencies of "Todo 2" When I expand the dependencies of "Todo 2"
Then I should see "Todo 3" within the dependencies of "Todo 2" Then I should see "Todo 3" within the dependencies of "Todo 2"
@selenium @wip @selenium @wip
Scenario: Adding dependency with comma to todo # for #975 Scenario: Adding dependency with comma to todo # for #975
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
| description | context | | description | context |
| test,1, 2,3 | @pc | | test,1, 2,3 | @pc |
| test me | @pc | | test me | @pc |
When I visit the "dependencies" project When I visit the "dependencies" project
And I drag "test me" to "test,1, 2,3" And I drag "test me" to "test,1, 2,3"
Then the dependencies of "test me" should include "test,1, 2,3" Then the dependencies of "test me" should include "test,1, 2,3"
When I edit the dependency of "test me" to '"test,1, 2,3" <"@pc"; "dependencies">,"test,1, 2,3" <"@pc"; "dependencies">' When I edit the dependency of "test me" to '"test,1, 2,3" <"@pc"; "dependencies">,"test,1, 2,3" <"@pc"; "dependencies">'
Then there should not be an error Then there should not be an error

View file

@ -1,5 +1,4 @@
Feature: Existing user logging in Feature: Existing user logging in
In order to keep my things private In order to keep my things private
As an existing user As an existing user
I want to log in with my username and password I want to log in with my username and password
@ -17,9 +16,9 @@ Feature: Existing user logging in
And I should see "<message>" And I should see "<message>"
Examples: Examples:
| user | password | there | message | | user | password | there | message |
| admin | secret | redirected to the home page | Login successful | | admin | secret | redirected to the home page | Login successful |
| admin | wrong | on the login page | Login unsuccessful | | admin | wrong | on the login page | Login unsuccessful |
Scenario Outline: Unauthorized users cannot access Tracks and need to log in first Scenario Outline: Unauthorized users cannot access Tracks and need to log in first
Given there exists a project called "top secret" for user "testuser" Given there exists a project called "top secret" for user "testuser"
@ -31,22 +30,22 @@ Feature: Existing user logging in
And I should see "<logout>" And I should see "<logout>"
Examples: Examples:
| page | next page | logout | | page | next page | logout |
| home page | home page | Logout (Test User) | | home page | home page | Logout (Test User) |
| contexts page | contexts page | Logout (Test User) | | contexts page | contexts page | Logout (Test User) |
| projects page | projects page | Logout (Test User) | | projects page | projects page | Logout (Test User) |
| notes page | notes page | Logout (Test User) | | notes page | notes page | Logout (Test User) |
| repeating todos page | repeating todos page | Logout (Test User) | | repeating todos page | repeating todos page | Logout (Test User) |
| statistics page | statistics page | Logout (Test User) | | statistics page | statistics page | Logout (Test User) |
| manage users page | manage users page | 401 Unauthorized | | manage users page | manage users page | 401 Unauthorized |
| integrations page | integrations page | Logout (Test User) | | integrations page | integrations page | Logout (Test User) |
| starred page | starred page | Logout (Test User) | | starred page | starred page | Logout (Test User) |
| tickler page | tickler page | Logout (Test User) | | tickler page | tickler page | Logout (Test User) |
| calendar page | calendar page | Logout (Test User) | | calendar page | calendar page | Logout (Test User) |
| feeds page | feeds page | Logout (Test User) | | feeds page | feeds page | Logout (Test User) |
| preference page | preference page | Logout (Test User) | | preference page | preference page | Logout (Test User) |
| export page | export page | Logout (Test User) | | export page | export page | Logout (Test User) |
| rest api docs page | rest api docs page | Logout (Test User) | | rest api docs page | rest api docs page | Logout (Test User) |
| search page | search page | Logout (Test User) | | search page | search page | Logout (Test User) |
| "top secret" project for user "testuser" | "top secret" project for user "testuser" | Logout (Test User) | | "top secret" project for user "testuser" | "top secret" project for user "testuser" | Logout (Test User) |
| context page for "@secret location" for user "testuser" | context page for "@secret location" for user "testuser" | Logout (Test User) | | context page for "@secret location" for user "testuser" | context page for "@secret location" for user "testuser" | Logout (Test User) |

View file

@ -1,5 +1,4 @@
Feature: Manage users Feature: Manage users
In order to be able to manage the users able to use Tracks In order to be able to manage the users able to use Tracks
As the administrator of this installed Tracks As the administrator of this installed Tracks
I want to add and delete accounts of users I want to add and delete accounts of users

View file

@ -1,5 +1,4 @@
Feature: View, add, remove notes Feature: View, add, remove notes
In order to manage my notes In order to manage my notes
As a Tracks user As a Tracks user
I want to view, add, and remove notes I want to view, add, and remove notes

View file

@ -1,5 +1,4 @@
Feature: Edit a project Feature: Edit a project
In order to reach a goal by doing several related todos In order to reach a goal by doing several related todos
As a Tracks user As a Tracks user
I want to manage these todos in a project I want to manage these todos in a project
@ -63,6 +62,3 @@ Feature: Edit a project
Then the badge should show 2 # "manage me" and "test" Then the badge should show 2 # "manage me" and "test"
When I try to edit the project name of "manage me" to "test" When I try to edit the project name of "manage me" to "test"
Then I should see "Name already exists" Then I should see "Name already exists"
# No scenario is needed for adding a todo to the project. This is covered in
# shared_add_new_todo.feature "I can add a todo from several pages"

View file

@ -1,5 +1,4 @@
Feature: Manage the list of projects Feature: Manage the list of projects
In order to keep track and manage of all my projects In order to keep track and manage of all my projects
As a Tracks user As a Tracks user
I want to manage my list of projects I want to manage my list of projects

View file

@ -1,5 +1,4 @@
Feature: Manage recurring todos Feature: Manage recurring todos
In order to manage repeating todos In order to manage repeating todos
As a Tracks user As a Tracks user
I want to view, edit, add, or remove recurrence patterns of repeating todos I want to view, edit, add, or remove recurrence patterns of repeating todos

View file

@ -1,5 +1,4 @@
Feature: Add new next action from every page Feature: Add new next action from every page
In order to quickly add a new next action In order to quickly add a new next action
As a Tracks user As a Tracks user
I want to to be able to add one or more new next actions from every page I want to to be able to add one or more new next actions from every page
@ -19,13 +18,13 @@ Feature: Add new next action from every page
When I follow "« Hide form" When I follow "« Hide form"
Then the single action form should not be visible Then the single action form should not be visible
Scenarios: Scenarios:
| action | page | | action | page |
| go to | home page | | go to | home page |
| go to | tickler page | | go to | tickler page |
| visit | project page for "test project"| | visit | project page for "test project" |
| visit | context page for "test context"| | visit | context page for "test context" |
| visit | tag page for "starred" | | visit | tag page for "starred" |
@selenium @selenium
Scenario Outline: I can hide the input form for multiple next actions Scenario Outline: I can hide the input form for multiple next actions
@ -37,13 +36,13 @@ Feature: Add new next action from every page
Then the single action form should not be visible Then the single action form should not be visible
And the multiple action form should not be visible And the multiple action form should not be visible
Scenarios: Scenarios:
| action | page | | action | page |
| go to | home page | | go to | home page |
| go to | tickler page | | go to | tickler page |
| visit | project page for "test project"| | visit | project page for "test project" |
| visit | context page for "test context"| | visit | context page for "test context" |
| visit | tag page for "starred" | | visit | tag page for "starred" |
@selenium @selenium
Scenario Outline: I can hide the input form and then choose both input forms Scenario Outline: I can hide the input form and then choose both input forms
@ -57,13 +56,13 @@ Feature: Add new next action from every page
Then the single action form should not be visible Then the single action form should not be visible
And the multiple action form should not be visible And the multiple action form should not be visible
Scenarios: Scenarios:
| action | page | | action | page |
| go to | home page | | go to | home page |
| go to | tickler page | | go to | tickler page |
| visit | project page for "test project"| | visit | project page for "test project" |
| visit | context page for "test context"| | visit | context page for "test context" |
| visit | tag page for "starred" | | visit | tag page for "starred" |
@selenium @selenium
Scenario Outline: I can switch forms for single next action to multiple next actions Scenario Outline: I can switch forms for single next action to multiple next actions
@ -76,49 +75,49 @@ Feature: Add new next action from every page
Then the single action form should be visible Then the single action form should be visible
And the multiple action form should not be visible And the multiple action form should not be visible
Scenarios: Scenarios:
| action | page | | action | page |
| go to | home page | | go to | home page |
| go to | tickler page | | go to | tickler page |
| visit | project page for "test project"| | visit | project page for "test project" |
| visit | context page for "test context"| | visit | context page for "test context" |
| visit | tag page for "starred" | | visit | tag page for "starred" |
@selenium @selenium
Scenario Outline: I can add a todo from several pages Scenario Outline: I can add a todo from several pages
When I <action> the <page> When I <action> the <page>
And I submit a new action with description "a new next action" And I submit a new action with description "a new next action"
Then I should <see> "a new next action" Then I should <see> "a new next action"
Scenarios: Scenarios:
| action | page | see | | action | page | see |
| go to | home page | see | | go to | home page | see |
| go to | tickler page | not see| | go to | tickler page | not see |
| visit | project page for "test project"| see | | visit | project page for "test project" | see |
| visit | context page for "test context"| see | | visit | context page for "test context" | see |
| visit | tag page for "starred" | not see| | visit | tag page for "starred" | not see |
@selenium @selenium
Scenario Outline: I can add multiple todos from several pages Scenario Outline: I can add multiple todos from several pages
When I <action> the <page> When I <action> the <page>
And I follow "Add multiple next actions" And I follow "Add multiple next actions"
And I submit multiple actions with using And I submit multiple actions with using
""" """
one new next action one new next action
another new next action another new next action
""" """
Then I should <see> "one new next action" Then I should <see> "one new next action"
And I should <see> "another new next action" And I should <see> "another new next action"
And the badge should show <badge> And the badge should show <badge>
And the number of actions should be <count> And the number of actions should be <count>
Scenarios: Scenarios:
| action | page | see | badge | count | | action | page | see | badge | count |
| go to | home page | see | 3 | 3 | | go to | home page | see | 3 | 3 |
| go to | tickler page | not see| 0 | 3 | | go to | tickler page | not see | 0 | 3 |
| visit | project page for "test project"| see | 3 | 3 | | visit | project page for "test project" | see | 3 | 3 |
| visit | context page for "test context"| see | 2 | 3 | | visit | context page for "test context" | see | 2 | 3 |
| visit | tag page for "starred" | not see| 0 | 3 | | visit | tag page for "starred" | not see | 0 | 3 |
@selenium @selenium
Scenario: I need to fill in at least one description and a context Scenario: I need to fill in at least one description and a context
@ -130,8 +129,8 @@ Feature: Add new next action from every page
Then I should see "Context can't be blank" Then I should see "Context can't be blank"
When I fill the multiple actions form with "", "a project", "test context", "tag" When I fill the multiple actions form with "", "a project", "test context", "tag"
And I submit the new multiple actions form with And I submit the new multiple actions form with
""" """
""" """
Then I should see "You need to submit at least one next action" Then I should see "You need to submit at least one next action"

View file

@ -1,5 +1,4 @@
Feature: Integrate Tracks in various ways Feature: Integrate Tracks in various ways
In order to use tracks with other software In order to use tracks with other software
As a Tracks user As a Tracks user
I want to be informed about the various ways to integrate tracks I want to be informed about the various ways to integrate tracks
@ -40,7 +39,7 @@ Feature: Integrate Tracks in various ways
Then I should see a script "<script>" for "<context2>" Then I should see a script "<script>" for "<context2>"
Examples: Examples:
| context1 | context2 | context-list | script | | context1 | context2 | context-list | script |
| @home | @boss | applescript1-contexts | applescript1 | | @home | @boss | applescript1-contexts | applescript1 |
| @shops | @home | applescript2-contexts | applescript2 | | @shops | @home | applescript2-contexts | applescript2 |
| @boss | @shops | quicksilver-contexts | quicksilver | | @boss | @shops | quicksilver-contexts | quicksilver |