grin 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ module Grin
18
18
 
19
19
  def photo(photo_id)
20
20
  photo = get("albums/#{id}/photos/#{photo_id}.json")
21
- if photo.respond_to?(:[]) && photo['status'] == 'error'
21
+ if photo.respond_to?(:[]) && photo['result'] == 'failure'
22
22
  return photo
23
23
  else
24
24
  Photo.new(photo)
@@ -18,7 +18,7 @@ module Grin
18
18
 
19
19
  def album(id)
20
20
  album = get("albums/#{id}.json")
21
- if album.respond_to?(:[]) && album['status'] == 'error'
21
+ if album.respond_to?(:[]) && album['result'] == 'failure'
22
22
  return album
23
23
  else
24
24
  Album.new(album)
@@ -27,7 +27,7 @@ module Grin
27
27
 
28
28
  def create_album(title, category_id = categories.first.id)
29
29
  album = post("albums.json", { :album => { :title => title, :category_id => category_id } })
30
- if album.respond_to?(:[]) && album['status'] == 'error'
30
+ if album.respond_to?(:[]) && album['result'] == 'failure'
31
31
  return album
32
32
  else
33
33
  Album.new(album)
@@ -50,7 +50,7 @@ module Grin
50
50
 
51
51
  def category(id)
52
52
  category = get("categories/#{id}.json")
53
- if category.respond_to?(:[]) && category['status'] == 'error'
53
+ if category.respond_to?(:[]) && category['result'] == 'failure'
54
54
  return category
55
55
  else
56
56
  Category.new(category)
@@ -59,7 +59,7 @@ module Grin
59
59
 
60
60
  def create_category(name)
61
61
  category = post("categories.json", { :category => { :name => name } })
62
- if category.respond_to?(:[]) && category['status'] == 'error'
62
+ if category.respond_to?(:[]) && category['result'] == 'failure'
63
63
  return category
64
64
  else
65
65
  Category.new(category)
@@ -43,8 +43,8 @@ class TestGrin < Test::Unit::TestCase
43
43
  should "delete the album followed by the category" do
44
44
  album_response = @album.destroy
45
45
  category_response = @category.destroy
46
- assert_equal "ok", album_response['status']
47
- assert_equal "ok", category_response['status']
46
+ assert_equal "success", album_response['result']
47
+ assert_equal "success", category_response['result']
48
48
  end
49
49
 
50
50
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 0
9
- version: 1.2.0
8
+ - 1
9
+ version: 1.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - James Miller
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-09 00:00:00 -07:00
17
+ date: 2010-09-10 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency