mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-23 09:16:10 +01:00
add tests for toggling visibility of collapsed contexts
This commit is contained in:
parent
30c2fb8b82
commit
cdff38995c
5 changed files with 127 additions and 5 deletions
|
|
@ -1,3 +1,17 @@
|
|||
When /^I collapse the context container of "([^"]*)"$/ do |context_name|
|
||||
context = @current_user.contexts.find_by_name(context_name)
|
||||
context.should_not be_nil
|
||||
|
||||
xpath = "//a[@id='toggle_c#{context.id}']"
|
||||
selenium.is_visible(xpath).should be_true
|
||||
|
||||
selenium.click(xpath)
|
||||
end
|
||||
|
||||
When /^I toggle all collapsed context containers$/ do
|
||||
click_link 'Toggle collapsed contexts'
|
||||
end
|
||||
|
||||
####### Context #######
|
||||
|
||||
Then /^I should not see the context "([^"]*)"$/ do |context_name|
|
||||
|
|
@ -17,6 +31,10 @@ Then /^I should not see the container for context "([^"]*)"$/ do |context_name|
|
|||
Then "I should not see the context \"#{context_name}\""
|
||||
end
|
||||
|
||||
Then /^I should not see the context container for "([^"]*)"$/ do |context_name|
|
||||
Then "I should not see the context \"#{context_name}\""
|
||||
end
|
||||
|
||||
Then /^the container for the context "([^"]*)" should not be visible$/ do |context_name|
|
||||
Then "I should not see the context \"#{context_name}\""
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,10 +16,6 @@ Given /^I have a project "([^\"]*)" with (.*) notes?$/ do |project_name, num|
|
|||
end
|
||||
end
|
||||
|
||||
When /^I click Toggle Notes$/ do
|
||||
click_link 'Toggle notes'
|
||||
end
|
||||
|
||||
When /^I add note "([^\"]*)" from the "([^\"]*)" project page$/ do |note, project|
|
||||
project = Project.find_by_name(project)
|
||||
project.notes.create!(:user_id => @current_user.id, :body => note)
|
||||
|
|
@ -44,6 +40,23 @@ When /^I edit the first note to "([^"]*)"$/ do |note_body|
|
|||
click_button "submit_note_#{id}"
|
||||
end
|
||||
|
||||
When /^I toggle the note of "([^"]*)"$/ do |todo_description|
|
||||
todo = @current_user.todos.find_by_description(todo_description)
|
||||
todo.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='line_todo_#{todo.id}']/div/a/img"
|
||||
|
||||
selenium.click(xpath)
|
||||
end
|
||||
|
||||
When /^I click Toggle Notes$/ do
|
||||
click_link 'Toggle notes'
|
||||
end
|
||||
|
||||
When /^I toggle all notes$/ do
|
||||
When "I click Toggle Notes"
|
||||
end
|
||||
|
||||
Then /^(.*) notes should be visible$/ do |number|
|
||||
# count number of project_notes
|
||||
count = 0
|
||||
|
|
|
|||
|
|
@ -163,7 +163,8 @@ Given /^I have a project "([^"]*)" that has the following todos$/ do |project_na
|
|||
new_todo = @current_user.todos.create!(
|
||||
:description => todo[:description],
|
||||
:context_id => context.id,
|
||||
:project_id=>@project.id)
|
||||
:project_id=>@project.id,
|
||||
:notes => todo[:notes])
|
||||
unless todo[:tags].nil?
|
||||
new_todo.tag_with(todo[:tags])
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue