Skip to content

Commit

Permalink
Some unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ulitink committed Oct 31, 2011
1 parent 4a88963 commit 7f68df9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ gem 'pg', :require => 'pg'
gem 'devise'
gem 'twitter'
gem 'will_paginate', '~> 3.0.2'
gem 'dynamic_form'
gem 'test-unit'

# Use unicorn as the web server
# gem 'unicorn'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GEM
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.0.3)
dynamic_form (1.1.4)
erubis (2.6.6)
abstract (>= 1.0.0)
faraday (0.7.5)
Expand Down Expand Up @@ -82,6 +83,7 @@ GEM
rdoc (3.10)
json (~> 1.4)
simple_oauth (0.1.5)
test-unit (2.4.0)
thor (0.14.6)
treetop (1.4.10)
polyglot
Expand All @@ -103,7 +105,9 @@ PLATFORMS

DEPENDENCIES
devise
dynamic_form
pg
rails (= 3.0.10)
test-unit
twitter
will_paginate (~> 3.0.2)
12 changes: 12 additions & 0 deletions test/fixtures/feeds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

forum:
loader: forum
loader_arg: http://devnet.jetbrains.com/community/feeds/threads?community=9778

thread:
loader: rss_records
loader_arg: http://devnet.jetbrains.com/community/feeds/messages?thread=313822

twitter:
loader: twitter
loader_arg: '@jetbrains'
15 changes: 8 additions & 7 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
php: {}
phpstorm:
email: [email protected]
encrypted_password: <%= Devise.friendly_token %> # $2a$10$3e9qHlucH2lMU/SqGePhLe85SkzWLYHN7cI8Vp/TsTQR8ttmH16ku # 123123

jetbrains:
email: [email protected]
encrypted_password: <%= Devise.friendly_token %>


two: {}
10 changes: 7 additions & 3 deletions test/unit/user_test.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
require 'test_helper'

class UserTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true

test "wrong email format" do
user = User.new
user.email = 'wrongemail'
user.encrypted_password = Devise.friendly_token
assert !user.save
end

end

0 comments on commit 7f68df9

Please sign in to comment.