Merge branch '2.3_branch' into master

This commit is contained in:
Dan Rice 2015-01-02 21:25:34 -05:00
commit 70191af76b
19 changed files with 3 additions and 450 deletions

View file

@ -1,44 +0,0 @@
Feature: Integrate Tracks in various ways
In order to use tracks with other software
As a Tracks user
I want to be informed about the various ways to integrate tracks
Background:
Given the following user record
| 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
When I go to the integrations page
Then I should see a message that you need a context to see scripts
Scenario: I can see scripts when I have one or more contexts
When I go to the integrations page
Then I should see scripts
@javascript
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"
@javascript
Scenario Outline: When I select a different context the example scripts should change accordingly
When I go to the integrations page
When I select "<context1>" from "<context-list>"
Then I should see a script "<script>" for "<context1>"
When I select "<context2>" from "<context-list>"
Then I should see a script "<script>" for "<context2>"
Examples:
| context1 | context2 | context-list | script |
| @home | @boss | applescript1-contexts | applescript1 |
| @shops | @home | applescript2-contexts | applescript2 |
| @boss | @shops | quicksilver-contexts | quicksilver |

View file

@ -1,20 +0,0 @@
Then /^I should see a message that you need a context to see scripts$/ do
step 'I should see "You do not have any context yet. The script will be available after you add your first context"'
end
Then /^I should see scripts$/ do
# check on a small snippet of the first applescript
step 'I should see "set returnValue to call xmlrpc"'
end
Then /^I should see a script "([^\"]*)" for "([^\"]*)"$/ do |script, context_name|
expect(page).to have_css("##{script}", :visible => true)
context = Context.where(:name => context_name).first
expect(page).to have_content("#{context.id} (* #{context_name} *)")
# make sure the text is found within the textarea
script_source = page.find(:xpath, "//textarea[@id='#{script}']").text
expect(script_source).to match(/#{context.id} \(\* #{context_name} \*\)/)
end