From 05b3b7cebc02f194b7e01f82dbfbc255c8445501 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 10 Nov 2010 16:52:05 +0100 Subject: [PATCH] refactor js and cucumber scenario for integrations page --- features/context_list.feature | 2 +- features/logging_in.feature | 1 - features/project_list.feature | 2 +- features/show_integration_options.feature | 34 +++++++++------ public/javascripts/application.js | 50 +++++++---------------- 5 files changed, 37 insertions(+), 52 deletions(-) diff --git a/features/context_list.feature b/features/context_list.feature index 3de7712c..b80da7b1 100644 --- a/features/context_list.feature +++ b/features/context_list.feature @@ -71,7 +71,7 @@ Feature: Manage the list of contexts | active | @phone | | hidden | @hidden| - @selenium @wip + @selenium Scenario: Cannot add a context with comma in the name When I go to the contexts page And I add a new active context "foo, bar" diff --git a/features/logging_in.feature b/features/logging_in.feature index fa02ccf0..3c742423 100644 --- a/features/logging_in.feature +++ b/features/logging_in.feature @@ -21,7 +21,6 @@ Feature: Existing user logging in | admin | secret | redirected to the home page | Login successful | | admin | wrong | on the login page | Login unsuccessful | - @wip Scenario Outline: Unauthorized users cannot access Tracks and need to log in first Given there exists a project called "top secret" for user "testuser" And there exists a context called "@secret location" for user "testuser" diff --git a/features/project_list.feature b/features/project_list.feature index 30dffdea..a73de6f6 100644 --- a/features/project_list.feature +++ b/features/project_list.feature @@ -108,7 +108,7 @@ Feature: Manage the list of projects When I sort the list by number of tasks Then the project "very busy" should be above the project "test" - @selenium @wip + @selenium Scenario: Cannot add a project with comma in the name When I go to the projects page And I submit a new project with name "foo,bar" diff --git a/features/show_integration_options.feature b/features/show_integration_options.feature index c77b5562..2cea081d 100644 --- a/features/show_integration_options.feature +++ b/features/show_integration_options.feature @@ -9,6 +9,12 @@ Feature: Integrate Tracks in various ways | login | password | is_admin | | testuser | secret | false | And I have logged in as "testuser" with password "secret" + And I have the following contexts: + | context | + | @pc | + | @home | + | @shops | + | @boss | Scenario: I cannot see scripts when I do not have a context Given I have no contexts @@ -21,18 +27,20 @@ Feature: Integrate Tracks in various ways Then I should see scripts @selenium - Scenario: When I select a different context the example scripts should change accoordingly - Given I have the following contexts: - | context | - | @pc | - | @home | - | @shops | - | @boss | + Scenario: The scripts on the page should be prefilled with the first context When I go to the integrations page Then I should see a script "applescript1" for "@pc" - When I select "@home" from "applescript1-contexts" - Then I should see a script "applescript1" for "@home" - When I select "@shops" from "applescript2-contexts" - Then I should see a script "applescript2" for "@shops" - When I select "@boss" from "quicksilver-contexts" - Then I should see a script "quicksilver" for "@boss" + + @selenium + Scenario Outline: When I select a different context the example scripts should change accordingly + When I go to the integrations page + When I select "" from "" + Then I should see a script "