beatport 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/VERSION +1 -1
  2. data/beatport.gemspec +9 -8
  3. data/lib/beatport.rb +1 -3
  4. data/lib/beatport/catalog/account_type.rb +7 -1
  5. data/lib/beatport/catalog/artist.rb +8 -5
  6. data/lib/beatport/catalog/audio_format.rb +5 -0
  7. data/lib/beatport/catalog/autocomplete.rb +1 -1
  8. data/lib/beatport/catalog/chart.rb +12 -6
  9. data/lib/beatport/catalog/country.rb +1 -1
  10. data/lib/beatport/catalog/feature.rb +1 -1
  11. data/lib/beatport/catalog/genre.rb +10 -6
  12. data/lib/beatport/catalog/label.rb +5 -5
  13. data/lib/beatport/catalog/mixed.rb +1 -1
  14. data/lib/beatport/catalog/release.rb +10 -5
  15. data/lib/beatport/catalog/search.rb +1 -1
  16. data/lib/beatport/catalog/slide.rb +3 -3
  17. data/lib/beatport/catalog/track.rb +18 -12
  18. data/lib/beatport/client.rb +9 -3
  19. data/lib/beatport/collection.rb +1 -1
  20. data/lib/beatport/support.rb +7 -0
  21. data/lib/beatport/support/inflector.rb +47 -0
  22. data/lib/beatport/support/parser.rb +10 -0
  23. data/lib/beatport/support/query_builder.rb +88 -0
  24. data/spec/catalog/account_type_spec.rb +29 -8
  25. data/spec/catalog/artist_spec.rb +41 -18
  26. data/spec/catalog/audio_format_spec.rb +23 -5
  27. data/spec/catalog/autocomplete_spec.rb +23 -14
  28. data/spec/catalog/chart_overview_spec.rb +4 -5
  29. data/spec/catalog/chart_spec.rb +37 -18
  30. data/spec/catalog/country_spec.rb +16 -14
  31. data/spec/catalog/currency_spec.rb +6 -4
  32. data/spec/catalog/genre_spec.rb +24 -50
  33. data/spec/catalog/home_spec.rb +7 -8
  34. data/spec/catalog/item_type_spec.rb +5 -3
  35. data/spec/catalog/label_spec.rb +20 -19
  36. data/spec/catalog/mixed_spec.rb +4 -4
  37. data/spec/catalog/release_spec.rb +26 -24
  38. data/spec/catalog/source_type_spec.rb +5 -3
  39. data/spec/catalog/track_spec.rb +31 -30
  40. data/spec/{inflector_spec.rb → support/inflector_spec.rb} +1 -1
  41. data/spec/{query_builder_spec.rb → support/query_builder_spec.rb} +13 -19
  42. metadata +10 -9
  43. data/lib/beatport/inflector.rb +0 -44
  44. data/lib/beatport/parser.rb +0 -8
  45. data/lib/beatport/query_builder.rb +0 -74
@@ -0,0 +1,10 @@
1
+ module Beatport
2
+ module Support
3
+ # A custom HTTParter parse that underscores the keys of the result
4
+ class Parser < HTTParty::Parser
5
+ def parse
6
+ Inflector.process_keys(super) { |k| Inflector.underscore(k) }
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,88 @@
1
+ module Beatport
2
+ module Support
3
+ # Converts a set of arguments into a format that beatport will understand
4
+ class QueryBuilder
5
+ SPECIAL_OPTIONS = ['sortBy', 'facets', 'returnFacets']
6
+
7
+ def single_result?
8
+ @single_result
9
+ end
10
+
11
+ def self.process(*args)
12
+ new.process(*args)
13
+ end
14
+
15
+ def special_option?(key)
16
+ SPECIAL_OPTIONS.include?(key)
17
+ end
18
+
19
+ def process(*args)
20
+ @single_result = false
21
+
22
+ options = args.last.is_a?(Hash) ? args.pop : {}
23
+ string_key_type = options.delete(:string_key_type) || :name
24
+ collection = options.delete(:collection)
25
+ key = options.delete(:key) || (args.length > 1 ? args.compact : args.first)
26
+
27
+ case key
28
+ when Integer
29
+ options[:id] = key
30
+ @single_result = true unless collection
31
+ when String, Symbol
32
+ options[string_key_type] = key.to_s
33
+ @single_result = true unless collection
34
+ when Array
35
+ options[:ids] = key.flatten
36
+ end
37
+
38
+ options = camelize_keys(options)
39
+
40
+ options.map do |key, value|
41
+ options[key] = send(Inflector.underscore("process_#{key}"), value) if special_option?(key)
42
+ end
43
+
44
+ options
45
+ end
46
+
47
+ # Camelizes all the keys in the options hash
48
+ def camelize_keys(options)
49
+ Inflector.process_keys(options) { |k| Inflector.camelize(k.to_s, false) }
50
+ end
51
+
52
+ # Special processing for sort_by keys
53
+ def process_sort_by(values)
54
+ map_values(values) do |value|
55
+ split_value(value, " ").join(" ")
56
+ end
57
+ end
58
+
59
+ # Special processing for facets
60
+ def process_facets(values)
61
+ map_values(values) do |value|
62
+ k, v = split_value(value, ':')
63
+ v.to_a.map {|v| "#{k}:#{v}"}.join(',')
64
+ end
65
+ end
66
+
67
+ # Special processing for return_facets
68
+ def process_return_facets(values)
69
+ map_values(values) do |value|
70
+ Inflector.camelize(value, false)
71
+ end
72
+ end
73
+
74
+ def map_values(values)
75
+ values = values.split(/,\s*/) if values.is_a?(String)
76
+ values.map do |value|
77
+ yield value
78
+ end.join(",")
79
+ end
80
+
81
+ def split_value(value, seperator)
82
+ value = value.split(seperator) if value.is_a?(String)
83
+
84
+ [Inflector.camelize(value.first, false), value.last]
85
+ end
86
+ end
87
+ end
88
+ end
@@ -3,14 +3,35 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe AccountType do
5
5
  describe 'structure' do
6
- before(:all) { @account_type = AccountType.all.first }
7
-
8
- it { @account_type.code.should == "AMEX" }
9
- it { @account_type.bpid.should == "1" }
10
- it { @account_type.cybersource_card_type.should == "003" }
11
- it { @account_type.issue_number_or_start_date_required.should == false }
12
- it { @account_type.validation_regex.should == /^3[47][0-9]{13}$/ }
13
- it { @account_type.images.small.url.should == "https://ak-secure-beatport.bpddn.com/images/creditcard/logo_cc_amex_37x23.gif"}
6
+ subject { AccountType.all.first }
7
+
8
+ it { should be_an(AccountType) }
9
+ its (:code) { should == "AMEX" }
10
+ its (:bpid) { should == "1" }
11
+ its (:name) { should == "American Express"}
12
+ its (:cybersource_card_type) { should == "003" }
13
+ its (:issue_number_or_start_date_required) { should == false }
14
+ its (:validation_regex) { should == /^3[47][0-9]{13}$/ }
15
+ its (:'images.small.url') { should == "https://ak-secure-beatport.bpddn.com/images/creditcard/logo_cc_amex_37x23.gif"}
16
+ end
17
+
18
+ describe '.all' do
19
+ subject { AccountType.all }
20
+
21
+ its (:length) { should be > 1 }
22
+ end
23
+
24
+ describe '.find' do
25
+ context "by id" do
26
+ pending "Isn't currently supported by beatport"
27
+ # subject { AccountType.find(2) }
28
+ # its (:name) { should == "Visa" }
29
+ end
30
+
31
+ context "by name" do
32
+ subject { AccountType.find('Visa') }
33
+ its (:name) { should == "Visa" }
34
+ end
14
35
  end
15
36
  end
16
37
  end
@@ -3,29 +3,52 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe Artist do
5
5
  describe 'structure' do
6
- before(:all) { @artist = Artist.find(7181) }
6
+ subject { Artist.find(7181) }
7
7
 
8
- it { @artist.id.should == 7181 }
9
- it { @artist.type.should == "artist" }
10
- it { @artist.name.should == "Above & Beyond" }
11
- it { @artist.slug.should == "above-and-beyond" }
12
- it { @artist.last_publish_date.should == Date.new(2011, 12, 15)}
13
- it { @artist.biography.should == "" }
14
- it { @artist.genres.length.should be > 1 }
15
- it { @artist.sub_genres.length.should be > 1 }
16
- it { @artist.top_downloads.length.should be > 1 }
17
- it { @artist.images.small.url.should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/20/491527.jpg" }
18
- it { @artist.images.medium.url.should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/30/491530.jpg" }
19
- it { @artist.images.large.url.should == "http://geo-media.beatport.com/items/imageCatalog/4000000/600000/80000/6000/400/20/4686424.jpg" }
20
- it { @artist.featured_releases.length.should be > 1 }
8
+ it { should be_an(Artist) }
9
+ its (:id) { should == 7181 }
10
+ its (:type) { should == "artist" }
11
+ its (:name) { should == "Above & Beyond" }
12
+ its (:slug) { should == "above-and-beyond" }
13
+ its (:last_publish_date) { should == Date.new(2011, 12, 15)}
14
+ its (:biography) { should == "" }
15
+ its (:'genres.length') { should be > 1 }
16
+ its (:'sub_genres.length') { should be > 1 }
17
+ its (:'top_downloads.length') { should be > 1 }
18
+ its (:'images.small.url') { should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/20/491527.jpg" }
19
+ its (:'images.medium.url') { should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/30/491530.jpg" }
20
+ its (:'images.large.url') { should == "http://geo-media.beatport.com/items/imageCatalog/4000000/600000/80000/6000/400/20/4686424.jpg" }
21
+ # its (:'featured_releases.length') { should be > 1 }
21
22
  end
22
23
 
23
24
  describe '.find' do
24
- it "should find Above & Beyond when given id 7181" do
25
- artist = Artist.find(7181)
26
- artist.id.should == 7181
25
+ context 'with a single id' do
26
+ subject { Artist.find(7181) }
27
+
28
+ it { should be_an(Artist) }
29
+ its (:id) { should == 7181 }
27
30
  end
28
- end
31
+
32
+ context 'with multiple ids' do
33
+ subject { Artist.find(7181, 7182) }
34
+
35
+ # it { should be_a(Collection) }
36
+ its (:length) { should == 2 }
37
+ it "returns the requested artists" do
38
+ subject.map(&:id).should == [7181, 7182]
39
+ end
40
+ end
41
+
42
+ context 'with an array of ids' do
43
+ subject { Artist.find([7181, 7182]) }
44
+
45
+ # it { should be_a(Collection) }
46
+ its (:length) { should == 2 }
47
+ it "returns the requested artists" do
48
+ subject.map(&:id).should == [7181, 7182]
49
+ end
50
+ end
51
+ end
29
52
 
30
53
  describe '.all' do
31
54
  it "should get arbitrary artists" do
@@ -3,12 +3,30 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe "AudioFormat" do
5
5
  describe 'structure' do
6
- before(:all) { @audio_format = AudioFormat.all.first }
6
+ subject { AudioFormat.all.first }
7
7
 
8
- it { @audio_format.id.should == 1 }
9
- it { @audio_format.name.should == "mp3" }
10
- it { @audio_format.person_preference_visibility.should == true }
8
+ it { should be_an(AudioFormat) }
9
+ its (:id) { should == 1 }
10
+ its (:name) { should == "mp3" }
11
+ its (:person_preference_visibility) { should == true }
11
12
  end
12
-
13
+
14
+ describe '.all' do
15
+ subject { AudioFormat.all }
16
+
17
+ its (:length) { should be > 1 }
18
+ end
19
+
20
+ describe '.find' do
21
+ context "by id" do
22
+ subject { AudioFormat.find(2) }
23
+ its (:name) { should == "m4a" }
24
+ end
25
+
26
+ context "by name" do
27
+ subject { AudioFormat.find('wav') }
28
+ its (:name) { should == "wav" }
29
+ end
30
+ end
13
31
  end
14
32
  end
@@ -3,23 +3,32 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe Autocomplete do
5
5
  describe 'stucture' do
6
- before(:all) { @result = Autocomplete.query('lutzen').first }
7
- it { @result.name.downcase.should match(/lutzen/) }
6
+ subject { Autocomplete.query('lutzen').first }
7
+
8
+ its (:'name.downcase') { should match(/lutzen/) }
8
9
  end
9
10
 
10
11
  describe 'collection' do
11
- before(:all) { @collection = Autocomplete.query('lutzen') }
12
- it { @collection.host.should == "api.beatport.com" }
13
- it { @collection.path.should == "/catalog/autocomplete" }
14
- it { @collection.query.should == "query=lutzen" }
15
- it { @collection.page.should == 1 }
16
- it { @collection.per_page.should == 10 }
17
- it { @collection.count.should be > 1 }
18
- it { @collection.total_pages.should be > 1 }
19
- it { @collection.next_query.should == "query=lutzen&page=2"}
20
- it { @collection.per_page_options.should_not be_nil }
21
- it { @collection.facets.should_not be_nil }
22
- it { @collection.spellcheck.should_not be_nil }
12
+ subject { Autocomplete.query('lutzen') }
13
+
14
+ its (:host) { should == "api.beatport.com" }
15
+ its (:path) { should == "/catalog/autocomplete" }
16
+ its (:query) { should == "query=lutzen" }
17
+ its (:page) { should == 1 }
18
+ its (:per_page) { should == 10 }
19
+ its (:count) { should be > 1 }
20
+ its (:total_pages) { should be > 1 }
21
+ its (:next_query) { should == "query=lutzen&page=2"}
22
+ its (:per_page_options) { should_not be_nil }
23
+ its (:facets) { should_not be_nil }
24
+ its (:spellcheck) { should_not be_nil }
25
+ end
26
+
27
+ describe '.query' do
28
+ subject { Autocomplete.query('lutzen', :page => 3, :per_page => 2)}
29
+
30
+ its (:page) { should == 3 }
31
+ its (:per_page) { should == 2 }
23
32
  end
24
33
  end
25
34
  end
@@ -3,12 +3,11 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe ChartOverview do
5
5
  describe '.get' do
6
- it "should have 16 newest charts and 4 featured charts" do
7
- overview = ChartOverview.get
6
+ subject { ChartOverview.get }
8
7
 
9
- overview.newest.length.should == 16
10
- overview.featured.length.should == 4
11
- end
8
+ it { should be_a(ChartOverview) }
9
+ its (:'newest.length') { should == 16 }
10
+ its (:'featured.length') { should == 4 }
12
11
  end
13
12
  end
14
13
  end
@@ -4,27 +4,46 @@ module Beatport::Catalog
4
4
  describe Chart do
5
5
 
6
6
  describe 'structure' do
7
- before(:all) { @chart = Chart.find(15722) }
8
- it { @chart.id.should == 15722 }
9
- it { @chart.type.should == "chart" }
10
- it { @chart.name.should == "Nitrous Oxide – April Top 10" }
11
- it { @chart.slug.should == "nitrous-oxide-april-top-10" }
12
- it { @chart.description.should == "" }
13
- it { @chart.publish_date.should == Date.new(2009, 05, 12) }
14
- it { @chart.price.to_s.should == '13.91' }
15
- it { @chart.audio_format_fee.wav.to_s.should == "9.00" }
16
- it { @chart.audio_format_fee.aiff.to_s.should == "9.00" }
17
- it { @chart.genres.map(&:name).should == ["Trance"] }
18
- it { @chart.images.small.url.should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/30/491534.jpg"}
19
- it { @chart.images.medium.url.should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/10000/2000/900/20/412921.jpg"}
20
- it { @chart.images.large.url.should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/10000/2000/900/20/412922.jpg"}
21
-
22
- it { @chart.tracks.length.should == 9 }
7
+ subject { Chart.find(15722) }
8
+
9
+ it { should be_a(Chart) }
10
+ its (:id) { should == 15722 }
11
+ its (:type) { should == "chart" }
12
+ its (:name) { should == "Nitrous Oxide – April Top 10" }
13
+ its (:slug) { should == "nitrous-oxide-april-top-10" }
14
+ its (:description) { should == "" }
15
+ its (:publish_date) { should == Date.new(2009, 05, 12) }
16
+ its (:'price.to_s') { should == '13.91' }
17
+ its (:'audio_format_fee.wav.to_s') { should == "9.00" }
18
+ its (:'audio_format_fee.aiff.to_s') { should == "9.00" }
19
+ specify { subject.genres.map(&:name).should == ["Trance"] }
20
+ its (:'images.small.url') { should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/90000/1000/500/30/491534.jpg"}
21
+ its (:'images.medium.url') { should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/10000/2000/900/20/412921.jpg"}
22
+ its (:'images.large.url') { should == "http://geo-media.beatport.com/items/imageCatalog/0/400000/10000/2000/900/20/412922.jpg"}
23
+ its (:'tracks.length') { should == 9 }
23
24
  end
24
25
 
25
26
  describe '.find' do
26
- chart = Chart.find(15722)
27
- chart.id.should == 15722
27
+ context 'with a single id' do
28
+ subject { Chart.find(15722) }
29
+ its (:id) { should == 15722 }
30
+ end
31
+
32
+ context 'with multiple ids' do
33
+ subject { Chart.find(15722, 15723) }
34
+ its (:length) { should == 2 }
35
+ it "returns the requested charts" do
36
+ subject.map(&:id).should == [15722, 15723]
37
+ end
38
+ end
39
+
40
+ context 'with an array of ids' do
41
+ subject { Chart.find([15722, 15723]) }
42
+ its (:length) { should == 2 }
43
+ it "returns the requested charts" do
44
+ subject.map(&:id).should == [15722, 15723]
45
+ end
46
+ end
28
47
  end
29
48
 
30
49
  describe '.all' do
@@ -3,20 +3,22 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe Country do
5
5
  describe 'structure' do
6
- before(:all) { @country = Country.find('au') }
7
- it { @country.id.should == 5 }
8
- it { @country.code.should == "AUS" }
9
- it { @country.code_short.should == "AU" }
10
- it { @country.name.should == "Australia" }
11
- it { @country.vat_enabled.should == false }
12
- it { @country.vat_rate.should == 0 }
13
- it { @country.iso3166_3.should == "AUS" }
14
- it { @country.iso3166_2.should == "AU" }
15
- it { @country.currency.code.should == "USD" }
16
- it { @country.currency.name.should == "Dollar" }
17
- it { @country.states.first.code.should == 'ACT' }
18
- it { @country.states.first.type.should == 'territory' }
19
- it { @country.states.first.name.should == "Australian Capital Territory" }
6
+ subject { Country.find('au') }
7
+
8
+ it { should be_a(Country) }
9
+ its (:id) { should == 5 }
10
+ its (:code) { should == "AUS" }
11
+ its (:code_short) { should == "AU" }
12
+ its (:name) { should == "Australia" }
13
+ its (:vat_enabled) { should == false }
14
+ its (:vat_rate) { should == 0 }
15
+ its (:iso3166_3) { should == "AUS" }
16
+ its (:iso3166_2) { should == "AU" }
17
+ its (:'currency.code') { should == "USD" }
18
+ its (:'currency.name') { should == "Dollar" }
19
+ its (:'states.first.code') { should == 'ACT' }
20
+ its (:'states.first.type') { should == 'territory' }
21
+ its (:'states.first.name') { should == "Australian Capital Territory" }
20
22
  end
21
23
  end
22
24
  end
@@ -3,10 +3,12 @@ require 'spec_helper'
3
3
  module Beatport::Catalog
4
4
  describe Currency do
5
5
  describe "structure" do
6
- before(:all) { @currency = Currency.all.first }
7
- it { @currency.id.should == 1 }
8
- it { @currency.code.should == "USD" }
9
- it { @currency.name.should == "Dollar" }
6
+ subject { Currency.all.first }
7
+
8
+ it { should be_a(Currency) }
9
+ its (:id) { should == 1 }
10
+ its (:code) { should == "USD" }
11
+ its (:name) { should == "Dollar" }
10
12
 
11
13
  end
12
14
  end
@@ -5,21 +5,18 @@ module Beatport::Catalog
5
5
  describe Genre do
6
6
 
7
7
  describe "structure" do
8
- before(:all) { @genre = Genre.find(7) }
9
-
10
- it { @genre.name.should == "Trance" }
11
- it { @genre.slug.should == "trance" }
12
- it { @genre.subgenres.length.should be > 1}
13
- it { @genre.slideshow.header.length.should be > 1 }
14
- it { @genre.slideshow.small.length.should be > 1 }
15
- it { @genre.top_downloads.length.should be > 1 }
8
+ subject { Genre.find(7) }
9
+
10
+ it { should be_a(Genre) }
11
+ its (:name) { should == "Trance" }
12
+ its (:slug) { should == "trance" }
13
+ its (:'subgenres.length') { should be > 1}
14
+ its (:'slideshow.header.length') { should be > 1 }
15
+ its (:'slideshow.small.length') { should be > 1 }
16
+ its (:'top_downloads.length') { should be > 1 }
16
17
  # it { @genre.features.length.should be > 1}
17
- end
18
-
19
- describe '.find' do
20
- it "should retrieve information about the trance genre via its id" do
21
- genre = Genre.find(7)
22
- genre.name.should == "Trance"
18
+
19
+
23
20
  =begin
24
21
  genre.features.each do |feature|
25
22
  if feature.autoload
@@ -28,6 +25,19 @@ module Beatport::Catalog
28
25
  end
29
26
  end
30
27
  =end
28
+ end
29
+
30
+ describe '.find' do
31
+ it "should retrieve information about the trance genre via its id" do
32
+ Genre.find(7).name.should == "Trance"
33
+ end
34
+
35
+ it "should retrieve information about the trance genre via the slug" do
36
+ Genre.find('trance').name.should == "Trance"
37
+ end
38
+
39
+ it "should retrieve information about the trance genre via the slug passed as a symbol" do
40
+ Genre.find(:trance).name.should == "Trance"
31
41
  end
32
42
 
33
43
  it "should return nil with an invalid id" do
@@ -48,18 +58,6 @@ module Beatport::Catalog
48
58
  genres = Genre.all(:subgenres => true)
49
59
  genres.first.subgenres.length.should be > 1
50
60
  end
51
-
52
- it "should retrieve information about the trance genre via the slug" do
53
- Genre.all('trance').first.name.should == "Trance"
54
- end
55
-
56
- it "should retrieve information about the trance genre via the slug passed as a symbol" do
57
- Genre.all(:trance).first.name.should == "Trance"
58
- end
59
-
60
- it "should retrieve information about the trance genre via its id" do
61
- Genre.all(7).first.name.should == "Trance"
62
- end
63
61
  end
64
62
 
65
63
  describe '.overview' do
@@ -81,18 +79,6 @@ module Beatport::Catalog
81
79
  genre = Genre.find(7)
82
80
  genre.top_downloads.length.should == 10
83
81
  end
84
-
85
- it "should return the top downloads of a genre loaded via all" do
86
- genre = Genre.all(7).first
87
- genre.top_downloads.length.should == 10
88
- end
89
-
90
- it "should return the same downloads no matter how the genre was loaded" do
91
- by_find = Genre.find(7)
92
- by_all = Genre.all(7).first
93
-
94
- by_find.top_downloads.map(&:id).should == by_all.top_downloads.map(&:id)
95
- end
96
82
  end
97
83
 
98
84
  describe '#slideshow' do
@@ -100,18 +86,6 @@ module Beatport::Catalog
100
86
  genre = Genre.find(7)
101
87
  genre.slideshow.header.length.should be > 1
102
88
  end
103
-
104
- it "should return the slideshow of a genre loaded via all" do
105
- genre = Genre.all(7).first
106
- genre.slideshow.header.length.should be > 1
107
- end
108
-
109
- it "should return the same slideshow no matter how the genre was loaded" do
110
- by_find = Genre.find(7)
111
- by_all = Genre.all(7).first
112
-
113
- by_find.slideshow.header.map(&:link).should == by_all.slideshow.header.map(&:link)
114
- end
115
89
  end
116
90
  end
117
91
  end