fixed all cucumber tests

This commit is contained in:
danielvincent 2011-01-07 16:44:27 -08:00
parent 98bcad5c59
commit c74dc120df
14 changed files with 62 additions and 44 deletions

View file

@ -16,20 +16,23 @@ class AspectsController < ApplicationController
@aspects = current_user.aspects @aspects = current_user.aspects
end end
@aspect_ids = @aspects.map{|a| a.id} # redirect to signup
post_ids = @aspects.map{|a| a.post_ids}.flatten! if current_user.getting_started == true || @aspects.blank?
@posts = Post.where(:id.in => post_ids, :_type => "StatusMessage").paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@post_hashes = hashes_for_posts @posts
@contacts = Contact.all(:aspect_ids.in => @aspect_ids, :user_id => current_user.id, :pending => false)
@contact_hashes = hashes_for_contacts @contacts
@aspect_hashes = hashes_for_aspects @aspects, @contacts, :limit => 8
@aspect = :all unless params[:a_ids]
if current_user.getting_started == true
redirect_to getting_started_path redirect_to getting_started_path
else
@aspect_ids = @aspects.map{|a| a.id}
post_ids = @aspects.map{|a| a.post_ids}.flatten!
@posts = Post.where(:id.in => post_ids, :_type => "StatusMessage").paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
@post_hashes = hashes_for_posts @posts
@contacts = Contact.all(:aspect_ids.in => @aspect_ids, :user_id => current_user.id, :pending => false)
@contact_hashes = hashes_for_contacts @contacts
@aspect_hashes = hashes_for_aspects @aspects, @contacts, :limit => 8
@aspect = :all unless params[:a_ids]
end end
end end

View file

@ -5,7 +5,7 @@
%h4 %h4
.right .right
= link_to t('contacts', :count => @contacts.count), aspects_manage_path = link_to t('contacts', :count => @contacts.count), aspects_manage_path, :title => t('aspects.manage.manage_aspects')
= @aspect_hashes.count = @aspect_hashes.count
= t('_aspects') = t('_aspects')

View file

@ -3,10 +3,7 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
#no_contacts.floating.empty_message{:style => ("display:none" unless contact_count == 0)} #no_contacts.floating.empty_message{:style => ("display:none" unless contact_count == 0)}
- if aspect == :all %h3=t('.nobody')
%h3=t('.nobody') - if current_user.invites > 0
- if current_user.invites > 0 %h4= link_to t('.invite'), new_user_invitation_path
%h4= link_to t('.invite'), new_user_invitation_path
- else
%h3=t('.nobody_in_aspect', :aspect_name => aspect.name)

View file

@ -8,14 +8,9 @@
#aspect_edit_pane #aspect_edit_pane
#aspect_edit_pane_header #aspect_edit_pane_header
%h4 %h4
.right.description
= "#{@aspect_contacts.count} contacts"
= @aspect = @aspect
.description
= link_to 'rename', '#' = "#{@aspect_contacts.count} contacts"
\.
\.
= link_to 'delete', @aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')
.person_tiles{:style => "display:none;"} .person_tiles{:style => "display:none;"}
- for contact in @aspect.contacts - for contact in @aspect.contacts
@ -32,3 +27,8 @@
- if @contacts.count > 0 - if @contacts.count > 0
= render 'shared/contact_list', :aspect_id => @aspect.id, :contact_hashes => @all_contacts = render 'shared/contact_list', :aspect_id => @aspect.id, :contact_hashes => @all_contacts
#aspect_edit_controls
= link_to 'rename', '#'
\/
= link_to 'delete', @aspect, :method => "delete", :confirm => t('.confirm_remove_aspect')

View file

@ -7,7 +7,7 @@
= include_javascripts :home = include_javascripts :home
.span-15.append-2 .span-15.append-2
/= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @contacts.count = render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @contacts.count
#aspect_stream_container #aspect_stream_container
= render 'aspect_stream', = render 'aspect_stream',
@ -18,7 +18,7 @@
.span-7.last .span-7.last
#home_user_badge #home_user_badge
= owner_image_link = owner_image_link
%h3{:style => "position:relative;display:inline-block;margin-left:12px;top:-8px;"} %h3{:style => "position:relative;"}
= current_user.name = current_user.name
.description .description
= link_to current_user.diaspora_handle, person_path(current_user.person) = link_to current_user.diaspora_handle, person_path(current_user.person)

View file

@ -9,9 +9,11 @@
= t('.manage_aspects') = t('.manage_aspects')
#section_header #section_header
%h2=t('.manage_aspects') .right
.right{:style=>"top:0;"} = link_to("+ #{t('.add_a_new_aspect')}", "#add_aspect_pane", :class => "new_aspect button", :title => t('.add_a_new_aspect'), :rel => 'facebox')
= link_to("+ #{t('.add_a_new_aspect')}", "#add_aspect_pane", :class => "new_aspect add_aspect_button button", :title => t('.add_a_new_aspect'))
%h2
=t('.manage_aspects')
#manage_aspect_zones #manage_aspect_zones
.span-4.append-1.last .span-4.append-1.last

View file

@ -23,7 +23,6 @@
.span-15.last .span-15.last
= render 'shared/publisher', :aspect => @aspect = render 'shared/publisher', :aspect => @aspect
= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @aspect_contacts_count, :options => false
#main_stream.stream{:data => {:guids => @aspect.id}} #main_stream.stream{:data => {:guids => @aspect.id}}
= render 'shared/stream', :posts => @post_hashes = render 'shared/stream', :posts => @post_hashes

View file

@ -7,7 +7,7 @@ Feature: User manages aspects
Scenario: creating an aspect Scenario: creating an aspect
Given I am signed in Given I am signed in
When I follow "Home" in the header When I follow "Home" in the header
And I follow "manage aspects" And I follow "Manage aspects"
And I follow "+ Add a new aspect" And I follow "+ Add a new aspect"
And I fill in "Name" with "Dorm Mates" in the modal window And I fill in "Name" with "Dorm Mates" in the modal window
And I press "Create" in the modal window And I press "Create" in the modal window

View file

@ -5,7 +5,7 @@ When /^(.*) in the header$/ do |action|
end end
When /^(.*) in the modal window$/ do |action| When /^(.*) in the modal window$/ do |action|
within('#fancybox-wrap') do within('#facebox') do
When action When action
end end
end end

View file

@ -11,7 +11,7 @@ end
Given 'I am signed in' do Given 'I am signed in' do
@me ||= Factory(:user, :getting_started => false) @me ||= Factory(:user_with_aspect, :getting_started => false)
When %(I go to the new user session page) When %(I go to the new user session page)
When %(I fill in "Username" with "#{@me.username}") When %(I fill in "Username" with "#{@me.username}")
When %(I fill in "Password" with "#{@me.password}") When %(I fill in "Password" with "#{@me.password}")

View file

@ -1,6 +1,7 @@
Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username, password| Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username, password|
Factory(:user, :username => username, :password => password, user = Factory(:user, :username => username, :password => password,
:password_confirmation => password, :getting_started => false) :password_confirmation => password, :getting_started => false)
user.aspects.create(:name => "Besties")
end end
Given /^a user with email "([^\"]*)"$/ do |email| Given /^a user with email "([^\"]*)"$/ do |email|

BIN
public/images/facebox/closelabel.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 140 B

View file

@ -120,7 +120,7 @@ header
:color #111 :color #111
:color rgba(30,30,30,0.98) :color rgba(30,30,30,0.98)
:background -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(25,25,25,0.83)), to(rgba(0,0,0,0.98))) :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(25,25,25,0.80)), to(rgba(0,0,0,0.98)))
:-webkit-box-shadow 0 1px 3px #111 :-webkit-box-shadow 0 1px 3px #111
:-moz-box-shadow 0 1px 2px #111 :-moz-box-shadow 0 1px 2px #111
@ -738,6 +738,7 @@ label
:cursor pointer :cursor pointer
#publisher #publisher
:z-index 0
:color #999 :color #999
:position relative :position relative
:margin :margin
@ -2138,6 +2139,8 @@ ul.show_comments
h4 h4
:color #eee :color #eee
:margin
:bottom 0
:width 400px :width 400px
.person_tiles .person_tiles
@ -2159,10 +2162,21 @@ ul.show_comments
:position absolute :position absolute
:left 6px :left 6px
#aspect_edit_controls
:margin
:top 8px
#home_user_badge #home_user_badge
:position relative
img
:position absolute
:left 0
h3 h3
:margin :position relative
:bottom 0 :top 4px
:margin :margin
:bottom 2em :bottom 2em
:padding :padding
@ -2171,3 +2185,6 @@ ul.show_comments
:border :border
:bottom 1px solid #ccc :bottom 1px solid #ccc
:padding
:left 60px

View file

@ -37,10 +37,9 @@
#facebox .close{ #facebox .close{
position:absolute; position:absolute;
top:5px; top:15px;
right:5px; right:20px;
padding:2px; padding:2px;
background:#fff;
} }
#facebox .close img{ #facebox .close img{
opacity:0.3; opacity:0.3;
@ -77,4 +76,4 @@
.facebox_overlayBG { .facebox_overlayBG {
background-color: #000; background-color: #000;
z-index: 99; z-index: 99;
} }