Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Got rid of contest gem to get 1.9.3 to work.

  • Loading branch information...
commit fd8cb4a23bc55b7a776501170e3d82be9d97d288 1 parent 033e093
@balvig authored
Showing with 58 additions and 65 deletions.
  1. +0 −1  Gemfile
  2. +0 −2  Gemfile.lock
  3. +58 −62 test/connections_test.rb
View
1  Gemfile
@@ -7,7 +7,6 @@ gemspec
# jquery-rails is used by the dummy application
gem 'jquery-rails'
-gem 'contest'
# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
View
2  Gemfile.lock
@@ -36,7 +36,6 @@ GEM
multi_json (~> 1.0)
arel (3.0.2)
builder (3.0.0)
- contest (0.1.3)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
@@ -94,6 +93,5 @@ PLATFORMS
DEPENDENCIES
connections!
- contest
jquery-rails
sqlite3
View
120 test/connections_test.rb
@@ -8,78 +8,74 @@ class ConnectionsTest < ActiveSupport::TestCase
@post = Post.create!
end
- context 'No Follow class defined for join table' do
- test '#follow' do
- assert !@follower.follows?(@user)
- @follower.follow(@user)
- assert @follower.follows?(@user)
- end
-
- test '#unfollow' do
- @follower.follow(@user)
- assert @follower.follows?(@user)
- @follower.unfollow(@user)
- assert !@follower.follows?(@user)
- end
-
- test '#toggle_follow' do
- @follower.toggle_follow(@user)
- assert @follower.follows?(@user)
- @follower.toggle_follow(@user)
- assert !@follower.follows?(@user)
- end
+ # No explicit Follow class defined
+ test '#follow' do
+ assert !@follower.follows?(@user)
+ @follower.follow(@user)
+ assert @follower.follows?(@user)
+ end
- test '#following' do
- @follower.follow(@user)
- @follower.follow(@post)
- assert_equal [@user], @follower.following(:user)
- assert_equal [@post], @follower.following(:post)
- end
+ test '#unfollow' do
+ @follower.follow(@user)
+ assert @follower.follows?(@user)
+ @follower.unfollow(@user)
+ assert !@follower.follows?(@user)
+ end
- test '#follows' do
- #TODO: What should happen if the Follow model isn't defined?
- #assert !@user.respond_to?(:follows)
- end
+ test '#toggle_follow' do
+ @follower.toggle_follow(@user)
+ assert @follower.follows?(@user)
+ @follower.toggle_follow(@user)
+ assert !@follower.follows?(@user)
+ end
- test '#followers' do
- @follower.follow(@user)
- @follower.follow(@post)
- assert_equal [@follower], @user.followers(:user)
- assert_equal [@follower], @post.followers(:user)
- end
+ test '#following' do
+ @follower.follow(@user)
+ @follower.follow(@post)
+ assert_equal [@user], @follower.following(:user)
+ assert_equal [@post], @follower.following(:post)
end
- context 'Like class defined for join table' do
+ test '#follows' do
+ #TODO: What should happen if the Follow model isn't defined?
+ #assert !@user.respond_to?(:follows)
+ end
- test '#like' do
- assert !@user.likes?(@post)
- @user.like(@post)
- assert @user.likes?(@post)
- end
+ test '#followers' do
+ @follower.follow(@user)
+ @follower.follow(@post)
+ assert_equal [@follower], @user.followers(:user)
+ assert_equal [@follower], @post.followers(:user)
+ end
- test '#unlike' do
- @user.like(@post)
- assert @user.likes?(@post)
- @user.unlike(@post)
- assert !@user.likes?(@post)
- end
+ # Explicit Like class defined
+ test '#like' do
+ assert !@user.likes?(@post)
+ @user.like(@post)
+ assert @user.likes?(@post)
+ end
- test '#toggle_like' do
- @user.toggle_like(@post)
- assert @user.likes?(@post)
- @user.toggle_like(@post)
- assert !@user.likes?(@post)
- end
+ test '#unlike' do
+ @user.like(@post)
+ assert @user.likes?(@post)
+ @user.unlike(@post)
+ assert !@user.likes?(@post)
+ end
- test '#liking' do
- @user.like(@post)
- assert_equal [@post], @user.liking(:post)
- end
+ test '#toggle_like' do
+ @user.toggle_like(@post)
+ assert @user.likes?(@post)
+ @user.toggle_like(@post)
+ assert !@user.likes?(@post)
+ end
- test '#likes' do
- @user.like(@post)
- assert_equal [@post], @user.likes.map(&:connectable)
- end
+ test '#liking' do
+ @user.like(@post)
+ assert_equal [@post], @user.liking(:post)
+ end
+ test '#likes' do
+ @user.like(@post)
+ assert_equal [@post], @user.likes.map(&:connectable)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.