2010-05-05 19:09:51 +02:00
|
|
|
Then /^I should see a message that you need a context to see scripts$/ do
|
2012-03-12 22:52:45 +01:00
|
|
|
step 'I should see "You do not have any context yet. The script will be available after you add your first context"'
|
2010-05-05 19:09:51 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Then /^I should see scripts$/ do
|
|
|
|
|
# check on a small snippet of the first applescript
|
2012-03-12 22:52:45 +01:00
|
|
|
step 'I should see "set returnValue to call xmlrpc"'
|
2010-05-05 19:09:51 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Then /^I should see a script "([^\"]*)" for "([^\"]*)"$/ do |script, context_name|
|
2012-03-12 22:52:45 +01:00
|
|
|
page.should have_css("##{script}", :visible => true)
|
2010-05-05 19:09:51 +02:00
|
|
|
context = Context.find_by_name(context_name)
|
|
|
|
|
|
2012-03-12 22:52:45 +01:00
|
|
|
page.should have_content("#{context.id} (* #{context_name} *)")
|
2010-05-05 19:09:51 +02:00
|
|
|
|
|
|
|
|
# make sure the text is found within the textarea
|
2012-03-12 22:52:45 +01:00
|
|
|
script_source = page.find(:xpath, "//textarea[@id='#{script}']").text
|
2010-05-05 19:09:51 +02:00
|
|
|
script_source.should =~ /#{context.id} \(\* #{context_name} \*\)/
|
|
|
|
|
end
|
|
|
|
|
|