Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 586b672 commit 0b9fa89b8bb19b27d83e9598fb7a5139a4fad980 @jeffdonthemic jeffdonthemic committed May 26, 2012
Showing with 31 additions and 7 deletions.
  1. +8 −4 test/fixtures/users.yml
  2. +23 −3 test/unit/user_test.rb
View
@@ -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
View
@@ -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.