From ddf95e2750eb5650aceac64a960147ac1856a79f Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Tue, 28 Dec 2010 19:14:47 -0800 Subject: [PATCH 1/2] couple more passing cucumber stories, changed the queries on request and notification --- app/controllers/users_controller.rb | 2 +- app/views/notifications/index.html.haml | 2 +- app/views/shared/_notification.haml | 2 +- features/step_definitions/custom_web_steps.rb | 2 +- features/support/paths.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 34a895578..81317021e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -71,7 +71,7 @@ class UsersController < ApplicationController @person = @user.person @profile = @user.profile @services = @user.services - @requests = Request.to(@person).all + @requests = Request.where(:recipient_id => @person.id).all @step = ((params[:step].to_i>0)&&(params[:step].to_i<5)) ? params[:step].to_i : 1 @step ||= 1 diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 45d504841..2e6e307b4 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -36,7 +36,7 @@ - notes.each do |note| %li.message{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} %span.from - = link_to "#{note.person.name.titleize}", person_path(note.person) + = link_to "#{note.actor.name.titleize}", person_path(note.actor) = object_link(note) %span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}" diff --git a/app/views/shared/_notification.haml b/app/views/shared/_notification.haml index 7f99239f7..cb68338c5 100644 --- a/app/views/shared/_notification.haml +++ b/app/views/shared/_notification.haml @@ -5,5 +5,5 @@ = link_to t('.new', :type => object.class.to_s, :from => object.person.name), object_path(object.post) -= link_to "#{note.person.name.titelize}", person_path(note.person) += link_to "#{note.actor.name.titelize}", person_path(note.actor) = object_link(note) diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index e12e383f0..2516c0547 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -37,7 +37,7 @@ When /^I wait for the aspects page to load$/ do end When /^I wait for the request's profile page to load$/ do - wait_until { current_path == person_path(Request.where(:recipient_id => @me.id).first.sender) } + wait_until { current_path == person_path(Request.where(:recipient_id => @me.person.id).first.sender) } end When /^I wait for the ajax to finish$/ do diff --git a/features/support/paths.rb b/features/support/paths.rb index 39d4e20ba..6ac317d49 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -12,7 +12,7 @@ module NavigationHelpers when /^my acceptance form page$/ accept_user_invitation_path(:invitation_token => @me.invitation_token) when /^the requestor's profile page$/ - person_path(Request.to(@me).first.from) + person_path(Request.where(:recipient_id => @me.person.id).first.sender) when /^"([^\"]*)"'s page$/ person_path(User.find_by_email($1).person) when /^"(\/.*)"/ From bd05e97c2963653245f3b8d5dafbbc17b5e486f8 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Tue, 28 Dec 2010 19:53:45 -0800 Subject: [PATCH 2/2] requiring the websocket lib file --- app/models/notification.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/notification.rb b/app/models/notification.rb index 14480536a..62d6ad840 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -3,6 +3,7 @@ # the COPYRIGHT file. # class Notification < ActiveRecord::Base + require File.join(Rails.root, 'lib/diaspora/web_socket') include Diaspora::Socketable belongs_to :recipient, :class_name => 'User'