Skip to content

Commit

Permalink
Fixed some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
buntine committed Dec 20, 2012
1 parent 8fdf810 commit 6f57fef
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions TODO
@@ -1,2 +1,3 @@
- Replace XML with JSON parsing.
- Ensure documented examples work!
- Update Wiki docs!
3 changes: 2 additions & 1 deletion lib/wrapper/resources/video.rb
Expand Up @@ -6,6 +6,7 @@ class Discogs::Video < Discogs::Resource
:embed,
:description,
:title,
:src
:src,
:uri

end
4 changes: 4 additions & 0 deletions lib/wrapper/wrapper.rb
Expand Up @@ -34,6 +34,10 @@ def get_label(name)
query_and_build "label/#{name}", Discogs::Label, {:releases => 1}
end

def get_user(username)
query_and_build "users/#{name}", Discogs::User
end

def search(term, options={})
opts = { :type => :all, :page => 1 }.merge(options)
params = { :q => term, :type => opts[:type], :page => opts[:page] }
Expand Down
7 changes: 4 additions & 3 deletions spec/resources/video_spec.rb
Expand Up @@ -30,14 +30,15 @@
@video.description.should == "The Persuader-Stockholm-Sodermalm"
end

#it "should have a uri attribute" do
# @video.uri.should == "http://www.youtube.com/watch?v=QVdDhOnoR8k"
#end
it "should have a uri attribute" do
@video.uri.should == "http://www.youtube.com/watch?v=QVdDhOnoR8k"
end

it "should have a title attribute" do
@video.title.should == "The Persuader"
end

# TODO: Find out why this is required. The docs do not mention an src attribute.
it "should have a src attribute" do
@video.src.should == "http://www.youtube.com/watch?v=QVdDhOnoR8k"
end
Expand Down
4 changes: 1 addition & 3 deletions spec/samples/valid_identifier.xml
@@ -1,3 +1 @@
<identifiers>
<identifier description="Runout Side A" type="Barcode" value="827170385962" />
</identifiers>
<identifier description="Runout Side A" type="Barcode" value="827170385962" />
2 changes: 1 addition & 1 deletion spec/samples/valid_video.xml
@@ -1 +1 @@
<video uri="http://www.youtube.com/watch?v=QVdDhOnoR8k" duration="334" embed="true" description="The Persuader-Stockholm-Sodermalm" title="The Persuader" />
<video uri="http://www.youtube.com/watch?v=QVdDhOnoR8k" src="http://www.youtube.com/watch?v=QVdDhOnoR8k" duration="334" embed="true" description="The Persuader-Stockholm-Sodermalm" title="The Persuader" />

0 comments on commit 6f57fef

Please sign in to comment.