Skip to content
Browse files

walls alone

  • Loading branch information...
1 parent 68410cb commit 1e20dfdbaa9ac77160777baece42ca4e674cf42a isaacjarquin committed Mar 23, 2012
Showing with 894 additions and 18 deletions.
  1. BIN .redcar/lucene/_82.cfs
  2. BIN .redcar/lucene/_82_1.del
  3. BIN .redcar/lucene/_83.cfs
  4. BIN .redcar/lucene/_83_1.del
  5. BIN .redcar/lucene/_84.cfs
  6. BIN .redcar/lucene/_84_1.del
  7. BIN .redcar/lucene/_85.cfs
  8. BIN .redcar/lucene/_85_1.del
  9. BIN .redcar/lucene/_86.cfs
  10. BIN .redcar/lucene/_86_1.del
  11. BIN .redcar/lucene/_87.cfs
  12. BIN .redcar/lucene/_87_1.del
  13. BIN .redcar/lucene/_88.cfs
  14. BIN .redcar/lucene/_88_1.del
  15. BIN .redcar/lucene/_89.cfs
  16. BIN .redcar/lucene/segments.gen
  17. BIN .redcar/lucene/segments_7i
  18. +1 −1 .redcar/lucene_last_updated
  19. +73 −5 .redcar/tags
  20. +1 −0 Gemfile
  21. +3 −0 Gemfile.lock
  22. +3 −2 app/assets/javascripts/application.js
  23. +260 −0 app/assets/javascripts/jquery.ui.chatbox.js
  24. +19 −0 app/assets/javascripts/messages.js
  25. +3 −0 app/assets/javascripts/walls.js.coffee
  26. +54 −0 app/assets/stylesheets/jquery.ui.chatbox.css
  27. +3 −0 app/assets/stylesheets/walls.css.scss
  28. +22 −0 app/controllers/messages_controller.rb
  29. +83 −0 app/controllers/walls_controller.rb
  30. +2 −0 app/helpers/walls_helper.rb
  31. +2 −0 app/models/message.rb
  32. +1 −0 app/models/user.rb
  33. +3 −0 app/models/wall.rb
  34. +8 −0 app/views/messages/_message.html.erb
  35. +5 −0 app/views/messages/create.js.erb
  36. +18 −0 app/views/messages/index.html.erb
  37. +21 −0 app/views/walls/_form.html.erb
  38. +6 −0 app/views/walls/edit.html.erb
  39. +23 −0 app/views/walls/index.html.erb
  40. +5 −0 app/views/walls/new.html.erb
  41. +10 −0 app/views/walls/show.html.erb
  42. +10 −0 config/private_pub.yml
  43. +4 −0 config/routes.rb
  44. +10 −0 db/migrate/20120220214319_create_messages.rb
  45. +9 −0 db/migrate/20120321184751_create_walls.rb
  46. +14 −2 db/schema.rb
  47. +28 −8 db/schema.rb~
  48. +101 −0 lib/social/cvxvxvc.rb
  49. +8 −0 private_pub.ru
  50. +7 −0 test/fixtures/messages.yml
  51. +7 −0 test/fixtures/walls.yml
  52. +49 −0 test/functional/walls_controller_test.rb
  53. +4 −0 test/unit/helpers/walls_helper_test.rb
  54. +7 −0 test/unit/message_test.rb
  55. +7 −0 test/unit/wall_test.rb
View
BIN .redcar/lucene/_82.cfs
Binary file not shown.
View
BIN .redcar/lucene/_82_1.del
Binary file not shown.
View
BIN .redcar/lucene/_83.cfs
Binary file not shown.
View
BIN .redcar/lucene/_83_1.del
Binary file not shown.
View
BIN .redcar/lucene/_84.cfs
Binary file not shown.
View
BIN .redcar/lucene/_84_1.del
Binary file not shown.
View
BIN .redcar/lucene/_85.cfs
Binary file not shown.
View
BIN .redcar/lucene/_85_1.del
Binary file not shown.
View
BIN .redcar/lucene/_86.cfs
Binary file not shown.
View
BIN .redcar/lucene/_86_1.del
Binary file not shown.
View
BIN .redcar/lucene/_87.cfs
Binary file not shown.
View
BIN .redcar/lucene/_87_1.del
Binary file not shown.
View
BIN .redcar/lucene/_88.cfs
Binary file not shown.
View
BIN .redcar/lucene/_88_1.del
Binary file not shown.
View
BIN .redcar/lucene/_89.cfs
Binary file not shown.
View
BIN .redcar/lucene/segments.gen
Binary file not shown.
View
BIN .redcar/lucene/segments_7i
Binary file not shown.
View
2 .redcar/lucene_last_updated
@@ -1 +1 @@
-1329651066
+1332432735
View
78 .redcar/tags
@@ -1,18 +1,28 @@
-1329651066
+1332432735
ACCEPTED /home/isaacjarquin/working/www/social/app/models/friendship.rb ACCEPTED =
Application /home/isaacjarquin/working/www/social/config/application.rb class Application
ApplicationController /home/isaacjarquin/working/www/social/app/controllers/application_controller.rb class ApplicationController
ApplicationHelper /home/isaacjarquin/working/www/social/app/helpers/application_helper.rb module ApplicationHelper
+BLOCKED /home/isaacjarquin/working/www/social/app/models/friendship.rb BLOCKED =
BrowsingTest /home/isaacjarquin/working/www/social/test/performance/browsing_test.rb class BrowsingTest
+ClassMethods /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb module ClassMethods
+ClassMethods /home/isaacjarquin/working/www/social/lib/social/followment_management.rb module ClassMethods
ClassMethods /home/isaacjarquin/working/www/social/lib/social/friends_management.rb module ClassMethods
ClassMethods /home/isaacjarquin/working/www/social/lib/social/groups_management.rb module ClassMethods
ClassMethods /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb module ClassMethods
+CreateFollowments /home/isaacjarquin/working/www/social/db/migrate/20120215212936_create_followments.rb class CreateFollowments
CreateFriendships /home/isaacjarquin/working/www/social/db/migrate/20120209215442_create_friendships.rb class CreateFriendships
CreateGroups /home/isaacjarquin/working/www/social/db/migrate/20120127193942_create_groups.rb class CreateGroups
CreateMemberships /home/isaacjarquin/working/www/social/db/migrate/20120208201522_create_memberships.rb class CreateMemberships
+CreateMessages /home/isaacjarquin/working/www/social/db/migrate/20120220214319_create_messages.rb class CreateMessages
CreateOwnerships /home/isaacjarquin/working/www/social/db/migrate/20120208201508_create_ownerships.rb class CreateOwnerships
CreateProfiles /home/isaacjarquin/working/www/social/db/migrate/20120127184412_create_profiles.rb class CreateProfiles
CreateUsers /home/isaacjarquin/working/www/social/db/migrate/20120126233759_create_users.rb class CreateUsers
+CreateWalls /home/isaacjarquin/working/www/social/db/migrate/20120321184751_create_walls.rb class CreateWalls
+Followment /home/isaacjarquin/working/www/social/app/models/followment.rb class Followment
+FollowmentManagement /home/isaacjarquin/working/www/social/lib/social/followment_management.rb module FollowmentManagement
+FollowmentTest /home/isaacjarquin/working/www/social/test/unit/followment_test.rb class FollowmentTest
+FriendsManagement /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb module FriendsManagement
FriendsManagement /home/isaacjarquin/working/www/social/lib/social/friends_management.rb module FriendsManagement
Friendship /home/isaacjarquin/working/www/social/app/models/friendship.rb class Friendship
FriendshipTest /home/isaacjarquin/working/www/social/test/unit/friendship_test.rb class FriendshipTest
@@ -22,11 +32,16 @@ GroupsController /home/isaacjarquin/working/www/social/app/controllers/groups_co
GroupsControllerTest /home/isaacjarquin/working/www/social/test/functional/groups_controller_test.rb class GroupsControllerTest
GroupsHelperTest /home/isaacjarquin/working/www/social/test/unit/helpers/groups_helper_test.rb class GroupsHelperTest
GroupsManagement /home/isaacjarquin/working/www/social/lib/social/groups_management.rb module GroupsManagement
+InstanceMethods /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb module InstanceMethods
+InstanceMethods /home/isaacjarquin/working/www/social/lib/social/followment_management.rb module InstanceMethods
InstanceMethods /home/isaacjarquin/working/www/social/lib/social/friends_management.rb module InstanceMethods
InstanceMethods /home/isaacjarquin/working/www/social/lib/social/groups_management.rb module InstanceMethods
InstanceMethods /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb module InstanceMethods
Membership /home/isaacjarquin/working/www/social/app/models/membership.rb class Membership
MembershipTest /home/isaacjarquin/working/www/social/test/unit/membership_test.rb class MembershipTest
+Message /home/isaacjarquin/working/www/social/app/models/message.rb class Message
+MessageTest /home/isaacjarquin/working/www/social/test/unit/message_test.rb class MessageTest
+MessagesController /home/isaacjarquin/working/www/social/app/controllers/messages_controller.rb class MessagesController
Ownership /home/isaacjarquin/working/www/social/app/models/ownership.rb class Ownership
OwnershipTest /home/isaacjarquin/working/www/social/test/unit/ownership_test.rb class OwnershipTest
PENDING /home/isaacjarquin/working/www/social/app/models/friendship.rb PENDING =
@@ -36,6 +51,7 @@ ProfilesController /home/isaacjarquin/working/www/social/app/controllers/profile
ProfilesControllerTest /home/isaacjarquin/working/www/social/test/functional/profiles_controller_test.rb class ProfilesControllerTest
ProfilesHelperTest /home/isaacjarquin/working/www/social/test/unit/helpers/profiles_helper_test.rb class ProfilesHelperTest
ProfilesManagement /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb module ProfilesManagement
+REJECTED /home/isaacjarquin/working/www/social/app/models/friendship.rb REJECTED =
REQUESTED /home/isaacjarquin/working/www/social/app/models/friendship.rb REQUESTED =
Social /home/isaacjarquin/working/www/social/config/application.rb module Social
TestCase /home/isaacjarquin/working/www/social/test/test_helper.rb class ActiveSupport::TestCase
@@ -45,46 +61,98 @@ UsersController /home/isaacjarquin/working/www/social/app/controllers/users_cont
UsersControllerTest /home/isaacjarquin/working/www/social/test/functional/users_controller_test.rb class UsersControllerTest
UsersHelper /home/isaacjarquin/working/www/social/app/helpers/users_helper.rb module UsersHelper
UsersHelperTest /home/isaacjarquin/working/www/social/test/unit/helpers/users_helper_test.rb class UsersHelperTest
-accept_friend /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def accept_friend(friend)
-add_friend /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def add_friend(friend)
-add_group /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def add_group(name)
+Wall /home/isaacjarquin/working/www/social/app/models/wall.rb class Wall
+WallTest /home/isaacjarquin/working/www/social/test/unit/wall_test.rb class WallTest
+WallsController /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb class WallsController
+WallsControllerTest /home/isaacjarquin/working/www/social/test/functional/walls_controller_test.rb class WallsControllerTest
+WallsHelper /home/isaacjarquin/working/www/social/app/helpers/walls_helper.rb module WallsHelper
+WallsHelperTest /home/isaacjarquin/working/www/social/test/unit/helpers/walls_helper_test.rb class WallsHelperTest
+accept /home/isaacjarquin/working/www/social/app/models/friendship.rb def accept
+accept_friendship_of /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def accept_friendship_of(friend)
+accept_friendship_of /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def accept_friendship_of(friend)
+add_group /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def add_group(name, description = "")
add_member /home/isaacjarquin/working/www/social/app/models/group.rb def add_member(user)
+block /home/isaacjarquin/working/www/social/app/models/friendship.rb def block
+block_friend /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def block_friend(friend)
+block_friend /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def block_friend(friend)
+can_request_to? /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def can_request_to?(friend)
+can_request_to? /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def can_request_to?(friend)
+cancel_friendship_with /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def cancel_friendship_with(friend)
+cancel_friendship_with /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def cancel_friendship_with(friend)
+cancel_request_to /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def cancel_request_to(friend)
+cancel_request_to /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def cancel_request_to(friend)
change /home/isaacjarquin/working/www/social/db/migrate/20120126233759_create_users.rb def change
change /home/isaacjarquin/working/www/social/db/migrate/20120127184412_create_profiles.rb def change
change /home/isaacjarquin/working/www/social/db/migrate/20120127193942_create_groups.rb def change
change /home/isaacjarquin/working/www/social/db/migrate/20120208201508_create_ownerships.rb def change
change /home/isaacjarquin/working/www/social/db/migrate/20120208201522_create_memberships.rb def change
change /home/isaacjarquin/working/www/social/db/migrate/20120209215442_create_friendships.rb def change
+change /home/isaacjarquin/working/www/social/db/migrate/20120215212936_create_followments.rb def change
+change /home/isaacjarquin/working/www/social/db/migrate/20120220214319_create_messages.rb def change
+change /home/isaacjarquin/working/www/social/db/migrate/20120321184751_create_walls.rb def change
create /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def create
+create /home/isaacjarquin/working/www/social/app/controllers/messages_controller.rb def create
create /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def create
create /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def create
+create /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def create
create_profile /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb def create_profile
destroy /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def destroy
destroy /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def destroy
destroy /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def destroy
+destroy /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def destroy
edit /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def edit
edit /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def edit
edit /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def edit
+edit /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def edit
+follow /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def follow(user)
get_all_users /home/isaacjarquin/working/www/social/app/helpers/users_helper.rb def get_all_users
-get_non_friends /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def get_non_friends
+group_exists? /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def group_exists?(name)
+included /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def self.included(base)
+included /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def self.included(base)
included /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def self.included(base)
included /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def self.included(base)
included /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb def self.included(base)
index /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def index
+index /home/isaacjarquin/working/www/social/app/controllers/messages_controller.rb def index
index /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def index
index /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def index
+index /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def index
+initialize /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def initialize
+initialize /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def initialize
initialize /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def initialize
initialize /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def initialize
initialize /home/isaacjarquin/working/www/social/lib/social/profiles_management.rb def initialize
+is_blocked_by? /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def is_blocked_by?(friend)
+is_blocked_by? /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def is_blocked_by?(friend)
+is_blocked_by? /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def is_blocked_by?(friend)
+is_followed_by? /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def is_followed_by?(user)
+is_following_to? /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def is_following_to?(user)
+is_friend_of? /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def is_friend_of?(friend)
+is_friend_of? /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def is_friend_of?(friend)
new /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def new
new /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def new
new /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def new
+new /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def new
+non_followeds /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def non_followeds
+non_followers /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def non_followers
+non_friends /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def non_friends
+non_friends /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def non_friends
+reject /home/isaacjarquin/working/www/social/app/models/friendship.rb def reject
+reject_friendship_of /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def reject_friendship_of(friend)
+reject_friendship_of /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def reject_friendship_of(friend)
remove_group /home/isaacjarquin/working/www/social/lib/social/groups_management.rb def remove_group(name)
remove_member /home/isaacjarquin/working/www/social/app/models/group.rb def remove_member(user)
+request_friendship_to /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def request_friendship_to(friend)
+request_friendship_to /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def request_friendship_to(friend)
show /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def show
show /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def show
show /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def show
+show /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def show
test_homepage /home/isaacjarquin/working/www/social/test/performance/browsing_test.rb def test_homepage
+unblock_friend /home/isaacjarquin/working/www/social/lib/social/cvxvxvc.rb def unblock_friend(friend)
+unblock_friend /home/isaacjarquin/working/www/social/lib/social/friends_management.rb def unblock_friend(friend)
+unfollow /home/isaacjarquin/working/www/social/lib/social/followment_management.rb def unfollow(user)
update /home/isaacjarquin/working/www/social/app/controllers/groups_controller.rb def update
update /home/isaacjarquin/working/www/social/app/controllers/profiles_controller.rb def update
update /home/isaacjarquin/working/www/social/app/controllers/users_controller.rb def update
+update /home/isaacjarquin/working/www/social/app/controllers/walls_controller.rb def update
View
1 Gemfile
@@ -27,6 +27,7 @@ end
gem 'jquery-rails'
gem 'private_pub'
+gem 'rbjs'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
3 Gemfile.lock
@@ -125,6 +125,8 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
+ rbjs (0.10.2)
+ json
rdoc (3.12)
json (~> 1.4)
rubyzip (0.9.5)
@@ -172,6 +174,7 @@ DEPENDENCIES
mysql2
private_pub
rails (= 3.2.1)
+ rbjs
sass-rails (~> 3.2.3)
therubyracer
uglifier (>= 1.0.3)
View
5 app/assets/javascripts/application.js
@@ -10,6 +10,7 @@
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
-//= require jquery
-//= require jquery_ujs
+// = require jquery
+// = require jquery_ujs
+// = require jquery-ui
//= require_tree .
View
260 app/assets/javascripts/jquery.ui.chatbox.js
@@ -0,0 +1,260 @@
+/*
+ * Copyright 2010, Wen Pu (dexterpu at gmail dot com)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Check out http://www.cs.illinois.edu/homes/wenpu1/chatbox.html for document
+ *
+ * Depends on jquery.ui.core, jquery.ui.widiget, jquery.ui.effect
+ *
+ * Also uses some styles for jquery.ui.dialog
+ *
+ */
+
+
+// TODO: implement destroy()
+(function($){
+ $.widget("ui.chatbox", {
+ options: {
+ id: null, //id for the DOM element
+ title: null, // title of the chatbox
+ user: null, // can be anything associated with this chatbox
+ hidden: false,
+ offset: 0, // relative to right edge of the browser window
+ width: 230, // width of the chatbox
+ messageSent: function(id, user, msg){
+ // override this
+ this.boxManager.addMsg(user.first_name, msg);
+ },
+ boxClosed: function(id) {}, // called when the close icon is clicked
+ boxManager: {
+ // thanks to the widget factory facility
+ // similar to http://alexsexton.com/?p=51
+ init: function(elem) {
+ this.elem = elem;
+ },
+ addMsg: function(peer, msg) {
+ var self = this;
+ var box = self.elem.uiChatboxLog;
+ var e = document.createElement('div');
+ $(e).html("<b>" + peer +":</b> " + msg)
+ .addClass("ui-chatbox-msg");
+ box.append(e);
+ self._scrollToBottom();
+
+ if(!self.elem.uiChatboxTitlebar.hasClass("ui-state-focus") && !self.highlightLock) {
+ self.highlightLock = true;
+ self.highlightBox();
+ }
+ },
+ highlightBox: function() {
+ //this.elem.uiChatbox.addClass("ui-state-highlight");
+ var self = this;
+ self.elem.uiChatboxTitlebar.effect("highlight", {}, 300);
+ self.elem.uiChatbox.effect("bounce", {times:3}, 300, function(){
+ self.highlightLock = false;
+ self._scrollToBottom();
+ });
+ },
+ toggleBox: function() {
+ this.elem.uiChatbox.toggle();
+ },
+ _scrollToBottom: function() {
+ var box = this.elem.uiChatboxLog;
+ box.scrollTop(box.get(0).scrollHeight);
+ }
+ }
+ },
+
+ toggleContent: function(event) {
+ this.uiChatboxContent.toggle();
+ if(this.uiChatboxContent.is(":visible")) {
+ this.uiChatboxInputBox.focus();
+ }
+ },
+
+ widget: function() {
+ return this.uiChatbox
+ },
+
+ _create: function(){
+ var self = this,
+ options = self.options,
+ title = options.title || "No Title",
+ // chatbox
+ uiChatbox = (self.uiChatbox = $('<div></div>'))
+ .appendTo(document.body)
+ .addClass('ui-widget ' +
+ 'ui-corner-top ' +
+ 'ui-chatbox'
+ )
+ .attr('outline', 0)
+ .focusin(function(){
+ // ui-state-highlight is not really helpful here
+ //self.uiChatbox.removeClass('ui-state-highlight');
+ self.uiChatboxTitlebar.addClass('ui-state-focus');
+ })
+ .focusout(function(){
+ self.uiChatboxTitlebar.removeClass('ui-state-focus');
+ }),
+ // titlebar
+ uiChatboxTitlebar = (self.uiChatboxTitlebar = $('<div></div>'))
+ .addClass('ui-widget-header ' +
+ 'ui-corner-top ' +
+ 'ui-chatbox-titlebar ' +
+ 'ui-dialog-header' // take advantage of dialog header style
+ )
+ .click(function(event) {
+ self.toggleContent(event);
+ })
+ .appendTo(uiChatbox),
+ uiChatboxTitle = (self.uiChatboxTitle = $('<span></span>'))
+ .html(title)
+ .appendTo(uiChatboxTitlebar),
+ uiChatboxTitlebarClose = (self.uiChatboxTitlebarClose = $('<a href="#"></a>'))
+ .addClass('ui-corner-all ' +
+ 'ui-chatbox-icon '
+ )
+ .attr('role', 'button')
+ .hover(function() {uiChatboxTitlebarClose.addClass('ui-state-hover');},
+ function() {uiChatboxTitlebarClose.removeClass('ui-state-hover');})
+ // .focus(function() {
+ // uiChatboxTitlebarClose.addClass('ui-state-focus');
+ // })
+ // .blur(function() {
+ // uiChatboxTitlebarClose.removeClass('ui-state-focus');
+ // })
+ .click(function(event) {
+ uiChatbox.hide();
+ self.options.boxClosed(self.options.id);
+ return false;
+ })
+ .appendTo(uiChatboxTitlebar),
+ uiChatboxTitlebarCloseText = $('<span></span>')
+ .addClass('ui-icon ' +
+ 'ui-icon-closethick')
+ .text('close')
+ .appendTo(uiChatboxTitlebarClose),
+ uiChatboxTitlebarMinimize = (self.uiChatboxTitlebarMinimize = $('<a href="#"></a>'))
+ .addClass('ui-corner-all ' +
+ 'ui-chatbox-icon'
+ )
+ .attr('role', 'button')
+ .hover(function() {uiChatboxTitlebarMinimize.addClass('ui-state-hover');},
+ function() {uiChatboxTitlebarMinimize.removeClass('ui-state-hover');})
+ // .focus(function() {
+ // uiChatboxTitlebarMinimize.addClass('ui-state-focus');
+ // })
+ // .blur(function() {
+ // uiChatboxTitlebarMinimize.removeClass('ui-state-focus');
+ // })
+ .click(function(event) {
+ self.toggleContent(event);
+ return false;
+ })
+ .appendTo(uiChatboxTitlebar),
+ uiChatboxTitlebarMinimizeText = $('<span></span>')
+ .addClass('ui-icon ' +
+ 'ui-icon-minusthick')
+ .text('minimize')
+ .appendTo(uiChatboxTitlebarMinimize),
+ // content
+ uiChatboxContent = (self.uiChatboxContent = $('<div></div>'))
+ .addClass('ui-widget-content ' +
+ 'ui-chatbox-content '
+ )
+ .appendTo(uiChatbox),
+ uiChatboxLog = (self.uiChatboxLog = self.element)
+ //.show()
+ .addClass('ui-widget-content '+
+ 'ui-chatbox-log'
+ )
+ .appendTo(uiChatboxContent),
+ uiChatboxInput = (self.uiChatboxInput = $('<div></div>'))
+ .addClass('ui-widget-content ' +
+ 'ui-chatbox-input'
+ )
+ .click(function(event) {
+ // anything?
+ })
+ .appendTo(uiChatboxContent),
+ uiChatboxInputBox = (self.uiChatboxInputBox = $('<textarea></textarea>'))
+ .addClass('ui-widget-content ' +
+ 'ui-chatbox-input-box ' +
+ 'ui-corner-all'
+ )
+ .appendTo(uiChatboxInput)
+ .keydown(function(event) {
+ if(event.keyCode && event.keyCode == $.ui.keyCode.ENTER) {
+ msg = $.trim($(this).val());
+ if(msg.length > 0) {
+ self.options.messageSent(self.options.id, self.options.user, msg);
+ }
+ $(this).val('');
+ return false;
+ }
+ })
+ .focusin(function() {
+ uiChatboxInputBox.addClass('ui-chatbox-input-focus');
+ var box = $(this).parent().prev();
+ box.scrollTop(box.get(0).scrollHeight);
+ })
+ .focusout(function() {
+ uiChatboxInputBox.removeClass('ui-chatbox-input-focus');
+ });
+
+ // disable selection
+ uiChatboxTitlebar.find('*').add(uiChatboxTitlebar).disableSelection();
+
+ // switch focus to input box when whatever clicked
+ uiChatboxContent.children().click(function(){
+ // click on any children, set focus on input box
+ self.uiChatboxInputBox.focus();
+ });
+
+ self._setWidth(self.options.width);
+ self._position(self.options.offset);
+
+ self.options.boxManager.init(self);
+
+ if(!self.options.hidden) {
+ uiChatbox.show();
+ }
+ },
+
+ _setOption: function(option, value) {
+ if(value != null){
+ switch(option) {
+ case "hidden":
+ if(value) {
+ this.uiChatbox.hide();
+ }
+ else {
+ this.uiChatbox.show();
+ }
+ break;
+ case "offset":
+ this._position(value);
+ break;
+ case "width":
+ this._setWidth(value);
+ break;
+ }
+ }
+
+ $.Widget.prototype._setOption.apply(this, arguments);
+ },
+
+ _setWidth: function(width) {
+ this.uiChatboxTitlebar.width(width + "px");
+ this.uiChatboxLog.width(width + "px");
+ // this is a hack, but i can live with it so far
+ this.uiChatboxInputBox.css("width", (width - 14) + "px");
+ },
+
+ _position: function(offset) {
+ this.uiChatbox.css("right", offset);
+ }
+ });
+
+}(jQuery));
View
19 app/assets/javascripts/messages.js
@@ -0,0 +1,19 @@
+/*
+<% publish_to "/messages/new" do %>
+ $("#chat").append("<%= j render(@message) %>");
+ $("#new_message")[0].reset();
+<% end %>
+*/
+$(document).ready(function(){
+ // to create
+ $("#link_add").click(function(){
+ alert("Hola");
+ $("#chat_div").chatbox({
+ id : "chat_div", title : "Title", user : "can be anything", offset: 200,
+ messageSent: function(id, user, msg){alert("DOM " + id + " just typed in " + msg);}
+ });
+ // to insert a message
+ //$("#chat_div").chatbox("option", "boxManager").addMsg("Mr. Foo", "Barrr!");
+ });
+});
+
View
3 app/assets/javascripts/walls.js.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
View
54 app/assets/stylesheets/jquery.ui.chatbox.css
@@ -0,0 +1,54 @@
+/* style sheets */
+.ui-chatbox {
+ position: fixed;
+ bottom:0;
+ padding: 2px 2px 2px 2px;
+ padding: 2px 2px 2px 2px;
+ background: #CCCCCC;
+ /* background: #CCCCCC; */
+}
+
+.ui-chatbox-titlebar {
+ padding: 3px 3px 3px 3px;
+ height: 20px;
+}
+
+.ui-chatbox-content {
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+ border: 0px;
+}
+
+.ui-chatbox-log {
+ padding: 3px 3px 3px 3px;
+ height: 150px;
+ overflow-y: auto;
+ background: #FFFFFF;
+}
+
+.ui-chatbox-input {
+ padding: 3px 3px 3px 3px;
+ border-top: 1px solid grey;
+ overflow: hidden;
+ /* background: #FFFFFF; */
+}
+
+.ui-chatbox-input-box {
+ margin: 5px 5px 5px 5px;
+ border: 2px solid lightgrey;/* #6699FF */
+ /* padding:5px 5px 5px 5px; */
+ height: 35px;
+}
+
+.ui-chatbox-icon {
+ float: right;
+}
+
+.ui-chatbox-input-focus {
+ border-color: #6699FF;
+}
+
+.ui-chatbox-msg {
+ float: left;
+ clear: both;
+}
View
3 app/assets/stylesheets/walls.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the walls controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
22 app/controllers/messages_controller.rb
@@ -0,0 +1,22 @@
+class MessagesController < ApplicationController
+
+ def index
+ @messages = Message.all
+ end
+
+ def create
+ @message = Message.create!(params[:message])
+ #PrivatePub.publish_to("/messages/new", "alert('#{@message.content}');")
+ #render :js do
+ # jQuery('#messages').append render @message
+ # jQuery('#new_message_text').val 'hola' #if @message.user_id == current_user_id
+ #end
+ #publish_to @message.channel do
+ #jQuery('#messages').append render @message
+ #jQuery('#new_message_text').val '' #if @message.user_id == current_user_id
+ #end
+ end
+
+
+end
+
View
83 app/controllers/walls_controller.rb
@@ -0,0 +1,83 @@
+class WallsController < ApplicationController
+ # GET /walls
+ # GET /walls.json
+ def index
+ @walls = Wall.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @walls }
+ end
+ end
+
+ # GET /walls/1
+ # GET /walls/1.json
+ def show
+ @wall = Wall.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @wall }
+ end
+ end
+
+ # GET /walls/new
+ # GET /walls/new.json
+ def new
+ @wall = Wall.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @wall }
+ end
+ end
+
+ # GET /walls/1/edit
+ def edit
+ @wall = Wall.find(params[:id])
+ end
+
+ # POST /walls
+ # POST /walls.json
+ def create
+ @wall = Wall.new(params[:wall])
+
+ respond_to do |format|
+ if @wall.save
+ format.html { redirect_to @wall, notice: 'Wall was successfully created.' }
+ format.json { render json: @wall, status: :created, location: @wall }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @wall.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /walls/1
+ # PUT /walls/1.json
+ def update
+ @wall = Wall.find(params[:id])
+
+ respond_to do |format|
+ if @wall.update_attributes(params[:wall])
+ format.html { redirect_to @wall, notice: 'Wall was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @wall.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /walls/1
+ # DELETE /walls/1.json
+ def destroy
+ @wall = Wall.find(params[:id])
+ @wall.destroy
+
+ respond_to do |format|
+ format.html { redirect_to walls_url }
+ format.json { head :no_content }
+ end
+ end
+end
View
2 app/helpers/walls_helper.rb
@@ -0,0 +1,2 @@
+module WallsHelper
+end
View
2 app/models/message.rb
@@ -0,0 +1,2 @@
+class Message < ActiveRecord::Base
+end
View
1 app/models/user.rb
@@ -3,4 +3,5 @@ class User < ActiveRecord::Base
include GroupsManagement
include FriendsManagement
include FollowmentManagement
+ has_one :wall
end
View
3 app/models/wall.rb
@@ -0,0 +1,3 @@
+class Wall < ActiveRecord::Base
+ belongs_to :user
+end
View
8 app/views/messages/_message.html.erb
@@ -0,0 +1,8 @@
+<%- @messages.each do |message| %>
+ <%= message.content %>
+<% end %>
+
+
+
+
+
View
5 app/views/messages/create.js.erb
@@ -0,0 +1,5 @@
+<% publish_to "/messages/new" do %>
+ $("#chat").append("<%= j render(@message) %>");
+ $("#new_message")[0].reset();
+<% end %>
+
View
18 app/views/messages/index.html.erb
@@ -0,0 +1,18 @@
+<h1>Chat</h1>
+
+<ul id="chat">
+ <%= render @messages %>
+</ul>
+
+<%= form_for Message.new, remote: true do |f| %>
+ <%= f.text_field :content %>
+ <%= f.submit "Send" %>
+<% end %>
+
+<%= subscribe_to "/messages/new" %>
+
+<a id="link_add" href="#">Add Chatbox</a>
+
+
+
+
View
21 app/views/walls/_form.html.erb
@@ -0,0 +1,21 @@
+<%= form_for(@wall) do |f| %>
+ <% if @wall.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@wall.errors.count, "error") %> prohibited this wall from being saved:</h2>
+
+ <ul>
+ <% @wall.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :user_id %><br />
+ <%= f.number_field :user_id %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
View
6 app/views/walls/edit.html.erb
@@ -0,0 +1,6 @@
+<h1>Editing wall</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Show', @wall %> |
+<%= link_to 'Back', walls_path %>
View
23 app/views/walls/index.html.erb
@@ -0,0 +1,23 @@
+<h1>Listing walls</h1>
+
+<table>
+ <tr>
+ <th>User</th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+
+<% @walls.each do |wall| %>
+ <tr>
+ <td><%= wall.user_id %></td>
+ <td><%= link_to 'Show', wall %></td>
+ <td><%= link_to 'Edit', edit_wall_path(wall) %></td>
+ <td><%= link_to 'Destroy', wall, confirm: 'Are you sure?', method: :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New Wall', new_wall_path %>
View
5 app/views/walls/new.html.erb
@@ -0,0 +1,5 @@
+<h1>New wall</h1>
+
+<%= render 'form' %>
+
+<%= link_to 'Back', walls_path %>
View
10 app/views/walls/show.html.erb
@@ -0,0 +1,10 @@
+<p id="notice"><%= notice %></p>
+
+<p>
+ <b>User:</b>
+ <%= @wall.user_id %>
+</p>
+
+
+<%= link_to 'Edit', edit_wall_path(@wall) %> |
+<%= link_to 'Back', walls_path %>
View
10 config/private_pub.yml
@@ -0,0 +1,10 @@
+development:
+ server: "http://localhost:9292/faye"
+ secret_token: "secret"
+test:
+ server: "http://localhost:9292/faye"
+ secret_token: "secret"
+production:
+ server: "http://example.com/faye"
+ secret_token: "530f863d4377372212f203d85c0e6f82aa2f2010e6c1dd8fac828cc708315274"
+ signature_expiration: 3600 # one hour
View
4 config/routes.rb
@@ -1,9 +1,13 @@
Social::Application.routes.draw do
+ resources :walls
+
resources :groups
resources :profiles
resources :users
+
+ resources :messages
# The priority is based upon order of creation:
# first created -> highest priority.
View
10 db/migrate/20120220214319_create_messages.rb
@@ -0,0 +1,10 @@
+class CreateMessages < ActiveRecord::Migration
+ def change
+ create_table :messages do |t|
+ t.string :title
+ t.test :content
+
+ t.timestamps
+ end
+ end
+end
View
9 db/migrate/20120321184751_create_walls.rb
@@ -0,0 +1,9 @@
+class CreateWalls < ActiveRecord::Migration
+ def change
+ create_table :walls do |t|
+ t.integer :user_id
+
+ t.timestamps
+ end
+ end
+end
View
16 db/schema.rb
@@ -11,8 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120304210350) do
-
+ActiveRecord::Schema.define(:version => 20120321184751) do
create_table "followments", :force => true do |t|
t.integer "user_id"
t.integer "followed_id"
@@ -51,6 +50,13 @@
add_index "memberships", ["group_id"], :name => "index_memberships_on_group_id"
add_index "memberships", ["user_id"], :name => "index_memberships_on_user_id"
+ create_table "messages", :force => true do |t|
+ t.string "title"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.text "content"
+ end
+
create_table "ownerships", :force => true do |t|
t.integer "user_id"
t.integer "group_id"
@@ -78,4 +84,10 @@
t.datetime "updated_at", :null => false
end
+ create_table "walls", :force => true do |t|
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
end
View
36 db/schema.rb~
@@ -12,7 +12,20 @@
# It's strongly recommended to check this file into your version control system.
<<<<<<< HEAD
-ActiveRecord::Schema.define(:version => 20120209215442) do
+ActiveRecord::Schema.define(:version => 20120304210350) do
+=======
+ActiveRecord::Schema.define(:version => 20120321184751) do
+>>>>>>> walls alone
+
+ create_table "followments", :force => true do |t|
+ t.integer "user_id"
+ t.integer "followed_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "followments", ["followed_id"], :name => "index_followments_on_followed_id"
+ add_index "followments", ["user_id"], :name => "index_followments_on_user_id"
create_table "friendships", :force => true do |t|
t.integer "user_id"
@@ -28,13 +41,10 @@ ActiveRecord::Schema.define(:version => 20120209215442) do
create_table "groups", :force => true do |t|
t.string "name"
t.string "description"
- t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
- add_index "groups", ["user_id"], :name => "index_groups_on_user_id"
-
create_table "memberships", :force => true do |t|
t.integer "user_id"
t.integer "group_id"
@@ -45,6 +55,13 @@ ActiveRecord::Schema.define(:version => 20120209215442) do
add_index "memberships", ["group_id"], :name => "index_memberships_on_group_id"
add_index "memberships", ["user_id"], :name => "index_memberships_on_user_id"
+ create_table "messages", :force => true do |t|
+ t.string "title"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.text "content"
+ end
+
create_table "ownerships", :force => true do |t|
t.integer "user_id"
t.integer "group_id"
@@ -64,15 +81,18 @@ ActiveRecord::Schema.define(:version => 20120209215442) do
t.datetime "updated_at", :null => false
end
- add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id_id"
-=======
-ActiveRecord::Schema.define(:version => 20120126233759) do
->>>>>>> pa descargar lo que esta en master
+ add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id"
create_table "users", :force => true do |t|
t.string "email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
+ create_table "walls", :force => true do |t|
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
end
View
101 lib/social/cvxvxvc.rb
@@ -0,0 +1,101 @@
+module FriendsManagement
+ def self.included(base)
+ base.send :include, InstanceMethods
+ base.send :extend, ClassMethods
+ base.send :initialize
+ end
+
+ module InstanceMethods
+ def non_friends
+ User.where("id != ?", self.id) - self.friends #My non_friends are all the users but me and my friends
+ end
+
+ def is_friend_of?(friend)
+ (self.non_friends.include?(friend)) ? false : true
+ end
+
+ def is_blocked_by?(friend)
+ (friend.blocked_friends.include?(self)) ? true : false
+ end
+
+ def can_request_to?(friend)
+ ((!self.is_friend_of?(friend)) && (!self.pending_friends.include?(friend)) && (!self.requested_friends.include?(friend))) ? true : false
+ end
+
+ def request_friendship_to(friend)
+ if (self.can_request_to?(friend)) #Only someone who is not still my friend can be requested
+ if (!friend.is_blocked_by?(self))
+ self.friendships.create(:friend_id => friend.id, :status => Friendship::REQUESTED)
+ return self.email + " has correctly requested " + friend.email + "'s friendship."
+ else
+ return self.email + " cannot request " + friend.email + "'s friendship because he/she has previously blocked that user."
+ end
+
+ if (!self.is_blocked_by?(friend)) #If my friend has not blocked me, he'll be notified about my request
+ friend.friendships.create(:friend_id => self.id, :status => Friendship::PENDING)
+ end
+ end
+ end
+
+ def cancel_request_to(friend)
+ if (self.requested_friends.include?(friend))
+ self.friendships.by_friend(friend).requested.first.destroy #Cancel my friendship request.
+ self.email + "'s friendship request to " + friend.email + " has been correctly canceled."
+ end
+ end
+
+ def accept_friendship_of(friend)
+ if (self.pending_friends.include?(friend))
+ self.friendships.by_friend(friend).pending.first.accept #I'm the friend of my friend.
+ friend.friendships.by_friend(self).requested.first.accept #My friend is a friend of mine.
+ self.email + " and " + friend.email + " are now friends."
+ end
+ end
+
+ def reject_friendship_of(friend)
+ if (self.pending_friends.include?(friend))
+ self.friendships.by_friend(friend).pending.first.destroy #My friendship is destroyed.
+ friend.friendships.by_friend(self).requested.first.reject #My friend's friendship is marked as rejected.
+ self.email + " has correctly rejected " + friend.email + "'s friendship request."
+ end
+ end
+
+ def cancel_friendship_with(friend)
+ if (self.is_friend_of?(friend))
+ self.friendships.by_friend(friend).first.destroy #My friendship is destroyed.
+ friend.friendships.by_friend(self).first.destroy #My friend's friendship is destroyed.
+ self.email + " and " + friend.email + " are not friends anymore."
+ else
+ self.email + " is not a friend of" + friend.email + "."
+ end
+ end
+
+ def block_friend(friend)
+ if ((self.can_request_to?(friend)) && (!self.blocked_friends.include?(friend)))
+ self.friendships.create(:friend_id => friend.id, :status => Friendship::BLOCKED) #My friendship is blocked.
+ self.email + " has correctly blocked " + friend.email + "."
+ else
+ "The user " + friend.email + " couldn't be blocked by " + self.email + "."
+ end
+ end
+
+ def unblock_friend(friend)
+ if (self.blocked_friends.include?(friend))
+ self.friendships.by_friend(friend).first.destroy #The blocked friendship is destroyed.
+ self.email + " has correctly unblocked " + friend.email + "."
+ else
+ "The user " + friend.email + " wasn't blocked by " + self.email + "."
+ end
+ end
+ end
+
+ module ClassMethods
+ def initialize
+ has_many :friendships, :dependent => :destroy
+ has_many :friends, :through => :friendships, :conditions => "status = 'accepted'"
+ has_many :requested_friends, :through => :friendships, :source => :friend, :conditions => "status = 'requested'", :order => :created_at
+ has_many :pending_friends, :through => :friendships, :source => :friend, :conditions => "status = 'pending'", :order => :created_at
+ has_many :blocked_friends, :through => :friendships, :source => :friend, :conditions => "status = 'blocked'", :order => :created_at
+ end
+ end
+end
View
8 private_pub.ru
@@ -0,0 +1,8 @@
+# Run with: rackup private_pub.ru -s thin -E production
+require "bundler/setup"
+require "yaml"
+require "faye"
+require "private_pub"
+
+PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
+run PrivatePub.faye_app
View
7 test/fixtures/messages.yml
@@ -0,0 +1,7 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ title: MyString
+
+two:
+ title: MyString
View
7 test/fixtures/walls.yml
@@ -0,0 +1,7 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ user_id: 1
+
+two:
+ user_id: 1
View
49 test/functional/walls_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class WallsControllerTest < ActionController::TestCase
+ setup do
+ @wall = walls(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:walls)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create wall" do
+ assert_difference('Wall.count') do
+ post :create, wall: @wall.attributes
+ end
+
+ assert_redirected_to wall_path(assigns(:wall))
+ end
+
+ test "should show wall" do
+ get :show, id: @wall
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @wall
+ assert_response :success
+ end
+
+ test "should update wall" do
+ put :update, id: @wall, wall: @wall.attributes
+ assert_redirected_to wall_path(assigns(:wall))
+ end
+
+ test "should destroy wall" do
+ assert_difference('Wall.count', -1) do
+ delete :destroy, id: @wall
+ end
+
+ assert_redirected_to walls_path
+ end
+end
View
4 test/unit/helpers/walls_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WallsHelperTest < ActionView::TestCase
+end
View
7 test/unit/message_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class MessageTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
View
7 test/unit/wall_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class WallTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end

0 comments on commit 1e20dfd

Please sign in to comment.
Something went wrong with that request. Please try again.