Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from qixotic/installation
Add support for _Installation objects.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'helper' | ||
require 'parse_resource' | ||
|
||
ParseResource::Base.load!(ENV["PARSE_RESOURCE_APPLICATION_ID"], ENV["PARSE_RESOURCE_MASTER_KEY"]) | ||
|
||
|
||
class Installation < ParseResource::Base | ||
end | ||
|
||
class TestParseUser < Test::Unit::TestCase | ||
#def setup | ||
# User.destroy_all | ||
#end | ||
|
||
#def teardown | ||
# User.destroy_all | ||
#end | ||
|
||
def test_creation | ||
Installation.destroy_all | ||
i = Installation.create(:deviceType => "ios", | ||
:deviceToken => "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", | ||
:channels => [""]) | ||
assert_not_nil(i.id) | ||
assert i.errors.empty? | ||
end | ||
|
||
def test_creation_validation_check | ||
Installation.destroy_all | ||
# missing deviceType | ||
i = Installation.create(:deviceToken => "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", | ||
:channels => [""]) | ||
assert_equal false, i.errors.empty? | ||
# TODO: actually check for the parse error code 135, once ParseError is | ||
# fixed to actually represent parse error codes. | ||
end | ||
|
||
end |