ultron 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ultron.rb +9 -19
- data/lib/ultron/auth.rb +17 -0
- data/lib/ultron/characters.rb +4 -0
- data/lib/ultron/comics.rb +4 -0
- data/lib/ultron/config.rb +1 -2
- data/lib/ultron/connection.rb +9 -9
- data/lib/ultron/creators.rb +4 -0
- data/lib/ultron/entities.rb +69 -0
- data/lib/ultron/events.rb +4 -0
- data/lib/ultron/helpers.rb +0 -16
- data/lib/ultron/series.rb +4 -0
- data/lib/ultron/stories.rb +4 -0
- data/lib/ultron/version.rb +1 -1
- data/spec/cassettes/Ultron_Characters/find_a_character.yml +99 -0
- data/spec/cassettes/Ultron_Characters/should_find_a_character.yml +99 -0
- data/spec/cassettes/Ultron_Characters/should_find_a_list_of_comics_featuring_the_character.yml +1782 -0
- data/spec/cassettes/{Ultron_API_Comic/should_have_the_correct_title.yml → Ultron_Comics/find_a_comic.yml} +8 -8
- data/spec/cassettes/{Ultron_API_Comic/should_have_the_correct_year.yml → Ultron_Comics/should_find_a_comic.yml} +8 -8
- data/spec/cassettes/Ultron_Connection/should_get_a_200.yml +10 -10
- data/spec/cassettes/{Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_creator.yml → Ultron_Creators/should_find_a_list_of_series_by_the_creator.yml} +252 -200
- data/spec/cassettes/Ultron_Events/should_find_a_list_of_stories_for_the_event.yml +346 -0
- data/spec/cassettes/Ultron_Events/should_find_an_event.yml +123 -0
- data/spec/ultron/characters_spec.rb +31 -0
- data/spec/ultron/comics_spec.rb +22 -0
- data/spec/ultron/config_spec.rb +9 -0
- data/spec/ultron/connection_spec.rb +13 -3
- data/spec/ultron/creators_spec.rb +26 -0
- data/spec/ultron/events_spec.rb +26 -0
- metadata +34 -236
- data/lib/ultron/api/character.rb +0 -19
- data/lib/ultron/api/characters.rb +0 -14
- data/lib/ultron/api/comic.rb +0 -15
- data/lib/ultron/api/comics.rb +0 -14
- data/lib/ultron/api/creator.rb +0 -19
- data/lib/ultron/api/creators.rb +0 -14
- data/lib/ultron/api/entities.rb +0 -78
- data/lib/ultron/api/entity.rb +0 -51
- data/lib/ultron/api/event.rb +0 -15
- data/lib/ultron/api/events.rb +0 -14
- data/lib/ultron/api/series.rb +0 -23
- data/lib/ultron/api/serieses.rb +0 -16
- data/lib/ultron/api/stories.rb +0 -14
- data/lib/ultron/api/story.rb +0 -15
- data/spec/cassettes/Ultron_API_Character/should_have_a_series_set.yml +0 -88
- data/spec/cassettes/Ultron_API_Character/should_have_an_events_set.yml +0 -32
- data/spec/cassettes/Ultron_API_Character/should_have_the_correct_name.yml +0 -88
- data/spec/cassettes/Ultron_API_Character/should_have_the_correct_sets/events.yml +0 -32
- data/spec/cassettes/Ultron_API_Character/should_not_have_any_events.yml +0 -32
- data/spec/cassettes/Ultron_API_CharacterSet/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/characters_filtered_by_comic/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_comic.yml +0 -1862
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_event.yml +0 -3876
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_series.yml +0 -743
- data/spec/cassettes/Ultron_API_Characters/generate_filtered_lists_of_characters/by_story.yml +0 -345
- data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_id.yml +0 -114
- data/spec/cassettes/Ultron_API_Characters/get_a_character_by_name/should_have_the_correct_name.yml +0 -114
- data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_id.yml +0 -99
- data/spec/cassettes/Ultron_API_Characters/get_a_character_with_a_space_in_their_name/should_have_the_correct_name.yml +0 -99
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_id.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_name.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/get_the_first_character_off_the_list/should_have_the_correct_resourceURI.yml +0 -644
- data/spec/cassettes/Ultron_API_Characters/parameterize_the_request/should_let_us_set_multiple_parameters.yml +0 -1595
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_comic.yml +0 -2737
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_event.yml +0 -7345
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_series.yml +0 -743
- data/spec/cassettes/Ultron_API_Characters/should_generate_a_list_of_characters_filtered_by_story.yml +0 -231
- data/spec/cassettes/Ultron_API_Characters/should_have_genarate_a_list_of_characters_filtered_by_comic.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/should_have_the_correct_first_character.yml +0 -1616
- data/spec/cassettes/Ultron_API_Characters/should_not_generate_a_list_of_characters_filtered_by_creator.yml +0 -31
- data/spec/cassettes/Ultron_API_Characters/should_not_generate_lists_of_characters/filtered_by_creator.yml +0 -31
- data/spec/cassettes/Ultron_API_Comic/should_have_a_list_of_characters.yml +0 -46
- data/spec/cassettes/Ultron_API_Comic/should_have_openstruct_method-style_attribute_accessors.yml +0 -46
- data/spec/cassettes/Ultron_API_ComicSet/should_have_the_correct_first_comic.yml +0 -2013
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_character.yml +0 -2059
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_creator.yml +0 -2177
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_event.yml +0 -1701
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_series.yml +0 -123
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_stories.yml +0 -499
- data/spec/cassettes/Ultron_API_Comics/generate_filtered_lists_of_comics/by_story.yml +0 -577
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_id.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_name.yml +0 -946
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_resourceURI.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/get_the_first_comic_off_the_list/should_have_the_correct_title.yml +0 -1039
- data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_dateRange.yml +0 -1613
- data/spec/cassettes/Ultron_API_Comics/parameterize_the_request/should_let_us_set_a_limit.yml +0 -96
- data/spec/cassettes/Ultron_API_Comics/should_generate_a_list_of_comics_filtered_by_character.yml +0 -3955
- data/spec/cassettes/Ultron_API_Comics/should_give_me_a_random_comic.yml +0 -118
- data/spec/cassettes/Ultron_API_Comics/should_have_the_correct_first_comic.yml +0 -2012
- data/spec/cassettes/Ultron_API_ComicsSet/should_have_the_correct_first_comic.yml +0 -2013
- data/spec/cassettes/Ultron_API_Creator/it_should_have_the_correct_sets/comics.yml +0 -2029
- data/spec/cassettes/Ultron_API_Creator/should_have_a_comics_set.yml +0 -2022
- data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_comic.yml +0 -2029
- data/spec/cassettes/Ultron_API_Creator/should_have_the_correct_name.yml +0 -243
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_comic.yml +0 -1205
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_event.yml +0 -2778
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_series.yml +0 -4555
- data/spec/cassettes/Ultron_API_Creators/generate_filtered_lists_of_creators/by_story.yml +0 -1253
- data/spec/cassettes/Ultron_API_Creators/get_a_creator_by_name/should_return_the_correct_creator.yml +0 -30
- data/spec/cassettes/Ultron_API_Creators/get_the_fourth_creator_off_the_list/should_have_the_right_name.yml +0 -1205
- data/spec/cassettes/Ultron_API_Creators/get_the_second_creator_off_the_list/should_have_the_right_name.yml +0 -384
- data/spec/cassettes/Ultron_API_Creators/should_give_me_a_random_creator.yml +0 -33
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_count.yml +0 -113
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_first_comic.yml +0 -32
- data/spec/cassettes/Ultron_API_Creators/should_have_the_correct_total.yml +0 -113
- data/spec/cassettes/Ultron_API_Creators/should_not_generate_a_list_of_creators_filtered_by_character.yml +0 -31
- data/spec/cassettes/Ultron_API_Creators/should_not_generate_lists_of_creators/filtered_by_character.yml +0 -31
- data/spec/cassettes/Ultron_API_Event/should_have_a_list_of_characters.yml +0 -195
- data/spec/cassettes/Ultron_API_Event/should_have_the_correct_first_character.yml +0 -195
- data/spec/cassettes/Ultron_API_Event/should_have_the_correct_title.yml +0 -108
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_character.yml +0 -5161
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_comic.yml +0 -363
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_creator.yml +0 -9257
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_series.yml +0 -240
- data/spec/cassettes/Ultron_API_Events/generate_filtered_lists_of_events/by_story.yml +0 -375
- data/spec/cassettes/Ultron_API_Events/get_the_second_event_off_the_list/should_have_the_right_name.yml +0 -4762
- data/spec/cassettes/Ultron_API_Events/should_give_me_a_random_event.yml +0 -9587
- data/spec/cassettes/Ultron_API_Series/should_have_the_correct_sets/not_series.yml +0 -40
- data/spec/cassettes/Ultron_API_Series/should_have_the_correct_title.yml +0 -40
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_character.yml +0 -3618
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_comic.yml +0 -31
- data/spec/cassettes/Ultron_API_Serieses/generate_filtered_lists_of_serieses/by_event.yml +0 -591
- data/spec/cassettes/Ultron_API_Serieses/get_the_third_event_off_the_list/should_have_the_right_name.yml +0 -1780
- data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_comic.yml +0 -31
- data/spec/cassettes/Ultron_API_Serieses/should_not_generate_lists_of_series/filtered_by_story.yml +0 -31
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_character.yml +0 -342
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_comic.yml +0 -110
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_creator.yml +0 -1041
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_event.yml +0 -846
- data/spec/cassettes/Ultron_API_Stories/generate_filtered_lists_of_stories/by_series.yml +0 -143
- data/spec/cassettes/Ultron_API_Stories/get_the_fourth_story_off_the_list/should_have_the_right_name.yml +0 -686
- data/spec/cassettes/Ultron_API_Stories/get_the_second_story_off_the_list/should_have_the_right_name.yml +0 -686
- data/spec/cassettes/Ultron_API_Story/should_have_the_correct_title.yml +0 -40
- data/spec/ultron/api/character_spec.rb +0 -50
- data/spec/ultron/api/comic_spec.rb +0 -51
- data/spec/ultron/api/creator_spec.rb +0 -50
- data/spec/ultron/api/event_spec.rb +0 -50
- data/spec/ultron/api/filtered_sets/characters_filtered_spec.rb +0 -53
- data/spec/ultron/api/filtered_sets/comics_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/creators_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/events_filtered_spec.rb +0 -51
- data/spec/ultron/api/filtered_sets/series_filtered_spec.rb +0 -50
- data/spec/ultron/api/filtered_sets/stories_filtered_spec.rb +0 -52
- data/spec/ultron/api/series_spec.rb +0 -46
- data/spec/ultron/api/sets/characters_spec.rb +0 -71
- data/spec/ultron/api/sets/comics_spec.rb +0 -53
- data/spec/ultron/api/sets/creators_spec.rb +0 -38
- data/spec/ultron/api/sets/events_spec.rb +0 -35
- data/spec/ultron/api/sets/serieses_spec.rb +0 -26
- data/spec/ultron/api/sets/stories_spec.rb +0 -26
- data/spec/ultron/api/story_spec.rb +0 -46
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Serieses do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of serieses' do
|
11
|
-
it 'by character', :vcr do
|
12
|
-
set = Serieses.new 'characters/1009368/series'
|
13
|
-
series = set[-1]
|
14
|
-
series.class.should == Series
|
15
|
-
series['id'].should == 9086
|
16
|
-
series['title'].should == 'Avengers Academy (2010 - 2012)'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'by creator', :vcr do
|
20
|
-
series = Serieses.new('creators/196/series')[0]
|
21
|
-
series['id'].should == 2114
|
22
|
-
series['title'].should == 'All-Winners Comics (1941 - 1947)'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'by event', :vcr do
|
26
|
-
set = Serieses.new 'events/279/series'
|
27
|
-
series = set[-1]
|
28
|
-
series['id'].should == 9808
|
29
|
-
series['title'].should == 'X-Men: Second Coming - Revelations: Blind Science (2010)'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
context 'should not generate lists of series' do
|
34
|
-
it 'filtered by comic', :vcr do
|
35
|
-
set = Serieses.new 'comics/5678/series'
|
36
|
-
set.any?.should == false
|
37
|
-
end
|
38
|
-
it 'filtered by story', :vcr do
|
39
|
-
set = Serieses.new 'stories/8765/series'
|
40
|
-
set.any?.should == false
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
after :each do
|
46
|
-
Timecop.return
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Stories do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
end
|
9
|
-
|
10
|
-
context 'generate filtered lists of stories' do
|
11
|
-
it 'by character', :vcr do
|
12
|
-
set = Stories.new 'characters/1009367/stories'
|
13
|
-
story = set[0]
|
14
|
-
story.class.should == Story
|
15
|
-
story['id'].should == 5872
|
16
|
-
story['title'].should == '1 of 7 - 7XLS'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'by comic', :vcr do
|
20
|
-
story = Stories.new('comics/41540/stories')[0]
|
21
|
-
story['id'].should == 93966
|
22
|
-
story['title'].should == 'Cover #93966'
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'by creator', :vcr do
|
26
|
-
set = Stories.new 'creators/457/stories'
|
27
|
-
story = set[-1]
|
28
|
-
story['id'].should == 851
|
29
|
-
story['title'].should == '1 of - Old Soldiers'
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'by event', :vcr do
|
33
|
-
set = Stories.new 'events/303/stories'
|
34
|
-
story = set[0]
|
35
|
-
story['id'].should == 80882
|
36
|
-
story['title'].should == 'X-Men Legacy (2008) #247'
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'by series', :vcr do
|
40
|
-
set = Stories.new 'series/9981/stories'
|
41
|
-
story = set[-1]
|
42
|
-
story['id'].should == 74319
|
43
|
-
story['title'].should == 'Interior #74319'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
after :each do
|
48
|
-
Timecop.return
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Series do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@series = Ultron::API::Series.new 15280
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'should have the correct sets' do
|
12
|
-
it 'characters', :vcr do
|
13
|
-
@series.characters.class.should == Characters
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'creators', :vcr do
|
17
|
-
@series.creators.class.should == Creators
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'events', :vcr do
|
21
|
-
@series.events.class.should == Events
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'not comics', :vcr do
|
25
|
-
@series.comics.class.should == NilClass
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'not series', :vcr do
|
29
|
-
@series.serieses.class.should == NilClass
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not stories', :vcr do
|
33
|
-
@series.stories.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct title', :vcr do
|
38
|
-
@series['title'].should == 'Amazing Fantasy 15: Spider-Man! (2011 - 2012)'
|
39
|
-
end
|
40
|
-
|
41
|
-
after :each do
|
42
|
-
Timecop.return
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Characters do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@characters = Ultron::API::Characters.new
|
9
|
-
end
|
10
|
-
|
11
|
-
after :each do
|
12
|
-
Timecop.return
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'get the first character off the list' do
|
16
|
-
before :each do
|
17
|
-
@character = @characters[0]
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should have the correct id', :vcr do
|
21
|
-
@character['id'].should == 1009521
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should have the correct name', :vcr do
|
25
|
-
@character['name'].strip.should == 'Hank Pym'
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should have the correct resourceURI', :vcr do
|
29
|
-
@character['resourceURI'].should == 'http://gateway.marvel.com/v1/public/characters/1009521'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
context 'get a character by name' do
|
34
|
-
before :each do
|
35
|
-
@character = @characters.by_name('Hulk')
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'should have the correct name', :vcr do
|
39
|
-
@character['name'].should == 'Hulk'
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should have the correct id', :vcr do
|
43
|
-
@character['id'].should == 1009351
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
context 'get a character with a space in their name' do
|
48
|
-
before :each do
|
49
|
-
@character = @characters.by_name('Doctor Doom')
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'should have the correct name', :vcr do
|
53
|
-
@character['name'].should == 'Doctor Doom'
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should have the correct id', :vcr do
|
57
|
-
@character['id'].should == 1009281
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
context 'parameterize the request', :vcr do
|
62
|
-
it 'should let us set multiple parameters', :vcr do
|
63
|
-
@characters.add_params limit: 10
|
64
|
-
@characters.add_params offset: 400
|
65
|
-
@characters.length.should == 10
|
66
|
-
@characters[0]['name'].should == 'Galactus'
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Comics do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@comics = Ultron::API::Comics.new
|
9
|
-
end
|
10
|
-
|
11
|
-
after :each do
|
12
|
-
Timecop.return
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'get the first comic off the list' do
|
16
|
-
before :each do
|
17
|
-
@comic = @comics[0]
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should have the correct id', :vcr do
|
21
|
-
@comic['id'].should == 41530
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'should have the correct title', :vcr do
|
25
|
-
@comic['title'].strip.should == 'Ant-Man: So (Trade Paperback)'
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'should have the correct resourceURI', :vcr do
|
29
|
-
@comic['resourceURI'].should == 'http://gateway.marvel.com/v1/public/comics/41530'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
context 'parameterize the request', :vcr do
|
34
|
-
it 'should let us set a limit', :vcr do
|
35
|
-
@comics.add_params limit: 1
|
36
|
-
@comics.length.should == 1
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should let us set a dateRange', :vcr do
|
40
|
-
@comics.add_params dateRange: '1980-01-01,1990-01-01'
|
41
|
-
@comics[0]['title'].should == 'Wolverine (1988) #20'
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'should give me a random comic', :vcr do
|
46
|
-
Comics.stub(:random_id).and_return(38207)
|
47
|
-
comic = Comics.shuffle
|
48
|
-
comic.class.should == Comic
|
49
|
-
comic['title'].should == 'The Mighty Thor (2011) #11'
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Creators do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@creators = Ultron::API::Creators.new
|
9
|
-
end
|
10
|
-
|
11
|
-
after :each do
|
12
|
-
Timecop.return
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'get the second creator off the list' do
|
16
|
-
before :each do
|
17
|
-
@creators.add_params offset: 600
|
18
|
-
@creator = @creators[1]
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should have the right name', :vcr do
|
22
|
-
@creator['fullName'].should == 'Nicholas Bertozzi'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should have the correct total', :vcr do
|
27
|
-
@creators.metadata['total'].should == 5558
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'should give me a random creator', :vcr do
|
31
|
-
Creators.stub(:random_id).and_return(9438)
|
32
|
-
creator = Creators.shuffle
|
33
|
-
creator.class.should == Creator
|
34
|
-
creator['fullName'].should == 'Sergio Aragones'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Events do
|
6
|
-
before :each do
|
7
|
-
# Config.instance.config['debug'] = true
|
8
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
9
|
-
@events = Ultron::API::Events.new
|
10
|
-
end
|
11
|
-
|
12
|
-
after :each do
|
13
|
-
Timecop.return
|
14
|
-
# Config.instance.reset!
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'get the second event off the list' do
|
18
|
-
before :each do
|
19
|
-
@event = @events[1]
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should have the right name', :vcr do
|
23
|
-
@event['title'].should == 'Age of Apocalypse'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should give me a random event', :vcr do
|
28
|
-
Events.stub(:random_id).and_return(233)
|
29
|
-
event = Events.shuffle
|
30
|
-
event.class.should == Event
|
31
|
-
event['title'].should == 'Atlantis Attacks'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Serieses do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@serieses = Ultron::API::Serieses.new
|
9
|
-
end
|
10
|
-
|
11
|
-
after :each do
|
12
|
-
Timecop.return
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'get the third event off the list' do
|
16
|
-
before :each do
|
17
|
-
@series = @serieses[2]
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should have the right name', :vcr do
|
21
|
-
@series['title'].should == '1602 (2003 - 2004)'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Stories do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@stories = Ultron::API::Stories.new
|
9
|
-
end
|
10
|
-
|
11
|
-
after :each do
|
12
|
-
Timecop.return
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'get the second story off the list' do
|
16
|
-
before :each do
|
17
|
-
@story = @stories[1]
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should have the right name', :vcr do
|
21
|
-
@story['title'].should match /Investigating the murder of a teenage girl, Cage suddenly learns/
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Ultron
|
4
|
-
module API
|
5
|
-
describe Story do
|
6
|
-
before :each do
|
7
|
-
Timecop.freeze '2014-02-08T21:20:00+00:00'
|
8
|
-
@story = Ultron::API::Story.new 15820
|
9
|
-
end
|
10
|
-
|
11
|
-
context 'should have the correct sets' do
|
12
|
-
it 'characters', :vcr do
|
13
|
-
@story.characters.class.should == Characters
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'comics', :vcr do
|
17
|
-
@story.comics.class.should == Comics
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'creators', :vcr do
|
21
|
-
@story.creators.class.should == Creators
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'events', :vcr do
|
25
|
-
@story.events.class.should == Events
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'series', :vcr do
|
29
|
-
@story.serieses.class.should == Serieses
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'not stories', :vcr do
|
33
|
-
@story.stories.class.should == NilClass
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should have the correct title', :vcr do
|
38
|
-
@story['title'].should == 'Cover #15820'
|
39
|
-
end
|
40
|
-
|
41
|
-
after :each do
|
42
|
-
Timecop.return
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|