Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdonthemic committed May 26, 2012
1 parent 586b672 commit 0b9fa89
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
12 changes: 8 additions & 4 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ one:
username: MyString
email: MyString
password: MyString
third_party_service: MyString
third_party_username: MyString
sfdc_username: one@test.cloudspokes.com
access_token: onetoken
profile_pic: http://www.google.com
accountid: one

two:
username: MyString
email: MyString
password: MyString
third_party_service: MyString
third_party_username: MyString
sfdc_username: two@test.cloudspokes.com
access_token: twotoken
profile_pic: http://www.google.com
accountid: two
26 changes: 23 additions & 3 deletions test/unit/user_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
require 'test_helper'

class UserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end

test "should not save" do
user = User.new
assert !user.save, "Saved the user without all required fields"
end

test "should save" do
user = User.new
user.username = 'me'
user.password = 'mypass'
user.sfdc_username = 'me@something.com'
assert user.save, "Could not save the user"
end

test "should not save without @ in sfdc_username" do
#user = users(:one)
user = User.new
user.username = 'me'
user.password = 'mypass'
user.sfdc_username = 'mesomething.com'
assert !user.save, "Saved the user without a correctly formatted sfdc_username"
end

end

0 comments on commit 0b9fa89

Please sign in to comment.