more work on the feature for ignoring a contact request

This commit is contained in:
Sarah Mei 2010-11-20 12:16:18 -08:00
parent 0a3a787ffa
commit 1309ee37dc

View file

@ -1,5 +1,5 @@
Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username, password|
Factory(:user, :username => username, :password => password,
Factory(:user, :username => username, :password => password,
:password_confirmation => password, :getting_started => false)
end
@ -13,7 +13,7 @@ Given /^I have an aspect called "([^"]*)"$/ do |aspect_name|
end
Given /^I have one contact request$/ do
other_user = make_user
other_user = make_user
other_aspect = other_user.aspects.create!(:name => "meh")
other_user.send_contact_request_to(@me.person, other_aspect)
@ -23,8 +23,10 @@ Given /^I have one contact request$/ do
end
Then /^I should see (\d+) contact request(?:s)?$/ do |request_count|
number_of_requests = evaluate_script("$('.person.request.ui-draggable').length")
number_of_requests.should == request_count.to_i
wait_until do
number_of_requests = evaluate_script("$('.person.request.ui-draggable').length")
number_of_requests == request_count.to_i
end
end
Then /^I should see (\d+) contact(?:s)? in "([^"]*)"$/ do |contact_count, aspect_name|
@ -39,3 +41,10 @@ When /^I drag the contact request to the "([^"]*)" aspect$/ do |aspect_name|
request_li = find(".person.request.ui-draggable")
request_li.drag_to(aspect_div)
end
When /^I click "X" on the contact request$/ do
evaluate_script <<-JS
window.confirm = function() { return true; };
$(".person.request.ui-draggable .delete").hover().click();
JS
end