diff --git a/app/views/aspects/create.js.erb b/app/views/aspects/create.js.erb index 7df0ce631..1b3b6d428 100644 --- a/app/views/aspects/create.js.erb +++ b/app/views/aspects/create.js.erb @@ -3,7 +3,7 @@ // the COPYRIGHT file. var dropdown = $("ul.dropdown_list[data-person_id=<%= @person.id %>]") -$('.newItem', dropdown).before("<%= escape_javascript( render('shared/aspect_dropdown_list_item', :aspect => @aspect, :person => @person, :contact => @contact)) %>"); +$('.newItem', dropdown).before("<%= escape_javascript( aspect_dropdown_list_item(@aspect, @contact.aspects.include?(@aspect))) %>"); ContactEdit.updateNumber(dropdown, "<%= @person.id %>", <%= @contact.aspects.size %>); $.facebox.close(); diff --git a/app/views/shared/_aspect_dropdown_list_item.haml b/app/views/shared/_aspect_dropdown_list_item.haml deleted file mode 100644 index d7508aa0c..000000000 --- a/app/views/shared/_aspect_dropdown_list_item.haml +++ /dev/null @@ -1,6 +0,0 @@ --# Copyright (c) 2011, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -= aspect_dropdown_list_item(aspect, contact, person) - diff --git a/features/posts.feature b/features/posts.feature index 95a6436eb..b95cea3cb 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -154,7 +154,8 @@ Feature: posting And I click "Mention" button And I expand the publisher in the modal window And I append "I am eating a yogurt" to the publisher - And I follow "DidntPostTo" within "#publisher" in the modal window + And I press the aspect dropdown in the modal window + And I toggle the aspect "DidntPostTo" in the modal window And I press "Share" in the modal window And I am on the aspects page And I follow "" within "#aspect_nav" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 08b99dd74..594ffc2f6 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -11,6 +11,15 @@ And /^I expand the publisher$/ do ') end +When /^I press the aspect dropdown$/ do + find('.dropdown .button').click +end + +And /^I toggle the aspect "([^"]*)"$/ do |aspect_name| + aspect = @me.aspects.where(:name => aspect_name).first + find("li[data-aspect_id='#{aspect.id}']").click +end + Then /^the publisher should be collapsed$/ do find("#publisher")["class"].should include("closed") end