Permalink
Browse files

synced specs with code

  • Loading branch information...
1 parent 815898b commit 9d7d52cbe9590583b219166867e364adf3006c88 @mkristian committed Jun 3, 2013
@@ -31,12 +31,13 @@
user['login'].should == 'root'
user['groups'].should have(1).items
user['groups'].each do |group|
- group.should have(5).items
+ group.should have(6).items
group['id'].should_not be_nil
group['name'].should == 'root'
group['regions'].should be_nil
group['locales'].should be_nil
group['domains'].should be_nil
+ group['application'].should have(2).items
end
user['applications'].should have(2).items
user['applications'].each do |app|
@@ -10,7 +10,7 @@
it "use single" do
body = JSON.parse(subject.to_json)
- #puts body.to_yaml
+ # puts body.to_yaml
application = body['application']
application.should have(9).items
application['id'].should_not be_nil
@@ -24,12 +24,15 @@
groups = application['groups']
groups.should have(2).items
groups.each do |group|
- group.should have(5).items
+ group.should have(8).items
group['id'].should_not be_nil
group['name'].should_not be_nil
- group['has_regions'].should == false
- group['has_locales'].should == false
- group['has_domains'].should == false
+ group['has_regions'].should_not be_nil
+ group['has_locales'].should_not be_nil
+ group['has_domains'].should_not be_nil
+ group['created_at'].should_not be_nil
+ group['updated_at'].should_not be_nil
+ group['modified_by'].should_not be_nil
end
end
@@ -69,18 +69,19 @@
it "use collection" do
body = JSON.parse(UserSerializer.new( User.all ).to_json)
+ # puts body.to_yaml
body.should have(3).items
user = body.each do |item|
user = item['user']
- user.should have(6).items
+ user.should have(8).items
user['id'].should_not be_nil
user['login'].should_not be_nil
user['name'].should_not be_nil
user['email'].should_not be_nil
user['updated_at'].should_not be_nil
user.key?('at_token').should == true
-# user['group_ids'].should_not be_nil
-# user['application_ids'].should_not be_nil
+ user['group_ids'].should_not be_nil
+ user['application_ids'].should_not be_nil
end
end

0 comments on commit 9d7d52c

Please sign in to comment.