diaspora/features/step_definitions/aspects_steps.rb
Juan Manuel Azambuja 1115e10536 Merge branch 'develop' into diaspora_with_sprites
Conflicts:
	Gemfile
	Gemfile.lock
	app/assets/stylesheets/application.css.sass
	app/assets/templates/comment_tpl.jst.hbs
	app/assets/templates/stream-element_tpl.jst.hbs
	app/helpers/aspects_helper.rb
	app/helpers/contacts_helper.rb
	app/views/aspects/_aspect_listings.haml
	app/views/aspects/toggle_contact_visibility.js.erb
	app/views/contacts/_aspect_listings.haml
	app/views/layouts/_header.html.haml
	app/views/shared/_footer.html.haml
	app/views/tags/_followed_tags_listings.haml
2013-03-11 20:10:55 -03:00

49 lines
1.3 KiB
Ruby

When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name|
step %{I hover over the "ul.sub_nav > li:contains('#{aspect_name}')"}
within("#aspect_nav") do
find('a > .edit').click
end
end
When /^I select only "([^"]*)" aspect$/ do |aspect_name|
within('#aspect_nav') do
click_link 'Aspects'
click_link 'Select all' if has_link? 'Select all'
end
step %{I wait for the ajax to finish}
within('#aspect_nav') do
click_link 'Deselect all' if has_link? 'Deselect all'
end
step %{I wait for the ajax to finish}
within('#aspect_nav') do
click_link aspect_name
end
step %{I wait for the ajax to finish}
end
When /^I select "([^"]*)" aspect as well$/ do |aspect_name|
within('#aspect_nav') do
click_link aspect_name
end
step %{I wait for the ajax to finish}
end
When /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do
page.has_css?("li.active[data-aspect_id='#{aspect.id}']").should be_true
end
end
When /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active)").should be_true
end
end