fixed cucumber with an exception of one step. added dropdowns to tag pages

This commit is contained in:
danielgrippi 2011-05-12 14:11:52 -07:00
parent 4280417e41
commit 3c82af49bf
11 changed files with 50 additions and 51 deletions

View file

@ -156,8 +156,7 @@ class AspectsController < ApplicationController
params[:max_time] ||= Time.now + 1 params[:max_time] ||= Time.now + 1
end end
protected private
def save_sort_order def save_sort_order
if params[:sort_order].present? if params[:sort_order].present?
session[:sort_order] = (params[:sort_order] == 'created_at') ? 'created_at' : 'updated_at' session[:sort_order] = (params[:sort_order] == 'created_at') ? 'created_at' : 'updated_at'
@ -167,4 +166,5 @@ class AspectsController < ApplicationController
session[:sort_order] = (session[:sort_order] == 'created_at') ? 'created_at' : 'updated_at' session[:sort_order] = (session[:sort_order] == 'created_at') ? 'created_at' : 'updated_at'
end end
end end
end end

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file. # the COPYRIGHT file.
class PhotosController < ApplicationController class PhotosController < ApplicationController
helper :comments helper :comments, :aspects
before_filter :authenticate_user! before_filter :authenticate_user!
respond_to :html, :json respond_to :html, :json

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file. # the COPYRIGHT file.
class TagsController < ApplicationController class TagsController < ApplicationController
helper :comments helper :comments, :aspects
skip_before_filter :set_invites skip_before_filter :set_invites
skip_before_filter :which_action_and_user skip_before_filter :which_action_and_user
skip_before_filter :set_grammatical_gender skip_before_filter :set_grammatical_gender

View file

@ -11,9 +11,9 @@
%ul.dropdown_list{:unSelectable => 'on'} %ul.dropdown_list{:unSelectable => 'on'}
- for aspect in @all_aspects - for aspect in @all_aspects
%li{:data => {:aspect_id => aspect.id}} %li{:data => {:aspect_id => aspect.id}}
= check_box_tag "in_aspect", "in_aspect", aspect.contacts.include?(contact) = check_box_tag "in_aspect", "in_aspect", (contact.persisted? && aspect.contacts.include?(contact))
= aspect.name = aspect.name
.hidden .hidden
= aspect_membership_button(aspect, contact, contact.person) = aspect_membership_button(aspect, contact, person)

View file

@ -26,7 +26,7 @@
= contact.person.diaspora_handle = contact.person.diaspora_handle
.right .right
= render 'aspect_dropdown', :contact => contact, :hang => 'right' = render 'aspect_dropdown', :contact => contact, :person => contact.person, :hang => 'right'
%br %br
%div{:style => "text-align:right;"} %div{:style => "text-align:right;"}

View file

@ -26,7 +26,7 @@
%hr{:style=>"width:300px;"} %hr{:style=>"width:300px;"}
%br %br
= render 'contacts/aspect_dropdown', :contact => @contact, :hang => 'left' = render 'contacts/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left'
-if contact.sharing? || person == current_user.person -if contact.sharing? || person == current_user.person
%br %br

View file

@ -36,8 +36,10 @@
.stream_element{:id => person.id} .stream_element{:id => person.id}
= person_image_link(person) = person_image_link(person)
- if current_user - if current_user
= render :partial => 'people/add_contact_small', - contact = current_user.contacts.find_by_person_id(person.id)
:locals => { :person => person } - contact ||= Contact.new(:person => person)
= render 'contacts/aspect_dropdown', :contact => contact, :person => person, :hang => 'left'
.content .content
%span.from %span.from
=person_link(person) =person_link(person)

View file

@ -7,9 +7,7 @@ Feature: sending and receiving requests
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I press the first ".share_with.button" And I add the person to my 1st aspect
And I wait for the ajax to finish
And I add the person to my first aspect
And I am on the home page And I am on the home page
Given I expand the publisher Given I expand the publisher
@ -45,11 +43,9 @@ Feature: sending and receiving requests
Scenario: mutual following the original follower should see private posts on their stream Scenario: mutual following the original follower should see private posts on their stream
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I press the 1st ".share_with.button" within "#author_info"
And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:first-child" And I add the person to my 1st aspect
And I wait for the ajax to finish And I add the person to my 2nd aspect
And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:nth-child(2)"
And I wait for the ajax to finish
When I go to the home page When I go to the home page
Then I go to the manage aspects page Then I go to the manage aspects page
@ -73,7 +69,9 @@ Feature: sending and receiving requests
Scenario: following a contact request into a new aspect Scenario: following a contact request into a new aspect
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I press the first ".share_with.button" within "#author_info" And I press the first ".share_with.button" within "#author_info"
And I fill in "Name" with "Super People" in the modal window And I fill in "Name" with "Super People" in the modal window
And I press "aspect_submit" in the modal window And I press "aspect_submit" in the modal window
And I wait for the ajax to finish And I wait for the ajax to finish
@ -87,41 +85,32 @@ Feature: sending and receiving requests
And I am on the manage aspects page And I am on the manage aspects page
Then I should see 1 contact in "Besties" Then I should see 1 contact in "Besties"
Scenario: should not see start sharing and see mention if already a follower Scenario: should not see "Add to aspect" and see mention if already a follower
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
Then I should not see "start sharing" Then I should see "In 1 aspect"
Then I should see "edit aspect membership"
Then I should see "Mention" Then I should see "Mention"
Then I should not see "Message" Then I should not see "Message"
Then I should not see "is sharing with you." Scenario: should see "Add to aspect" and not see mention if on a follower's page
Scenario: should see start sharing and not see mention if on a follower's page
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
Then I should see "start sharing" Then I should not see /^In \d aspects?$/
Then I should not see "edit aspect membership"
Then I should not see "Mention" Then I should not see "Mention"
Then I should not see "Message" Then I should not see "Message"
Then I should see "is sharing with you." Scenario: should see "Add to aspect" & mention & message on mutual contacts
Scenario: should see start sharing & mention & message on mutual contacts
When I sign in as "alice@alice.alice" When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
And I press the 1st ".share_with.button" within "#author_info"
And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:first-child" And I add the person to my 1st aspect
And I wait for the ajax to finish And I add the person to my 2nd aspect
And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:nth-child(2)"
And I wait for the ajax to finish
And I am on "bob@bob.bob"'s page And I am on "bob@bob.bob"'s page
Then I should not see "start sharing" Then I should not see "Add to aspect"
Then I should see "edit aspect membership" Then I should see "In 2 aspects"
Then I should see "Mention" Then I should see "Mention"
Then I should see "Message" Then I should see "Message"
Then I should see "is sharing with you."

View file

@ -10,9 +10,7 @@ Feature: disconnecting users
When I sign in as "bob@bob.bob" When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page And I am on "alice@alice.alice"'s page
And I press the first ".share_with.button" And I add the person to my 1st aspect
And I wait for the ajax to finish
And I add the person to my first aspect
Scenario Outline: remove non-mutual contact from the contact show page Scenario Outline: remove non-mutual contact from the contact show page
When I am on "alice@alice.alice"'s page When I am on "alice@alice.alice"'s page

View file

@ -159,11 +159,25 @@ Then /^I should( not)? see the contact dialog$/ do |not_see|
end end
end end
When /^I add the person to my first aspect$/ do When /^I add the person to my ([\d])(nd|rd|st|th) aspect$/ do |aspect_number, nd|
steps %Q{ steps %Q{
And I press the first ".add.button" within "#facebox #aspects_list ul > li:first-child" And I press the first ".toggle.button"
And I press the #{aspect_number}#{nd} "li" within ".dropdown.active .dropdown_list"
And I wait for the ajax to finish And I wait for the ajax to finish
Then I should see a ".added.button" within "#facebox #aspects_list ul > li:first-child" And I press the first ".toggle.button"
}
end
When /^I add the person to a new aspect called "([^\"]*)"$/ do |aspect_name|
steps %Q{
And I press the first ".toggle.button"
And I press click ".new_aspect" within ".dropdown.active"
And I fill in "#aspect_name" with "#{aspect_name}"
And I submit the form
And I wait for the ajax to finish
And I press the first ".toggle.button"
} }
end end

View file

@ -13,13 +13,9 @@ Feature: Interacting with tags
Scenario: adding a contact from a tag page Scenario: adding a contact from a tag page
When I search for "#rockstar" When I search for "#rockstar"
Then I should see an add contact button Then I should see "Add to aspect"
When I click on the add contact button When I add the person to my 1st aspect
Then I should see the contact dialog
When I add the person to my first aspect
And I follow "done editing"
Then I should not see the contact dialog
When I search for "#rockstar" When I search for "#rockstar"
Then I should not see an add contact button Then I should see "In 1 aspect"