Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Gemfile b/Gemfile
- index 6c38390..e1f7d82 100644
- --- a/Gemfile
- +++ b/Gemfile
- @@ -28,6 +28,6 @@ gem 'sqlite3'
- # Bundle gems for the local environment. Make sure to
- # put test-only gems in this group so their generators
- # and rake tasks are available in development mode:
- -# group :development, :test do
- -# gem 'webrat'
- -# end
- +group :development, :test do
- + gem 'awesome_print', :require => 'ap'
- +end
- diff --git a/Gemfile.lock b/Gemfile.lock
- index 37fc417..b881d98 100644
- --- a/Gemfile.lock
- +++ b/Gemfile.lock
- @@ -29,6 +29,7 @@ GEM
- activesupport (= 3.0.9)
- activesupport (3.0.9)
- arel (2.0.10)
- + awesome_print (0.4.0)
- builder (2.1.2)
- crack (0.1.8)
- erubis (2.6.6)
- @@ -77,6 +78,7 @@ PLATFORMS
- ruby
- DEPENDENCIES
- + awesome_print
- meta-spotify
- rails (= 3.0.9)
- sqlite3
- diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb
- index 56f0d30..1c86997 100644
- --- a/app/controllers/albums_controller.rb
- +++ b/app/controllers/albums_controller.rb
- @@ -8,10 +8,9 @@
- def show
- @album = Album.find(params[:id])
- - @spotify = MetaSpotify::Album.lookup(@album.spotify_uri, :extras => "track")
- -
- - @tracks = @spotify.tracks
- + @spotify = MetaSpotify::Album.lookup("spotify:album:2A0S2YIT08e4k52C4I8yfL", :extras => "track")
- + @tracks = @spotify.tracks.to_a
- end
- # GET /albums/new
- @@ -36,7 +35,6 @@
- :artist => @spotify_album.artists.first.name,
- :released => @spotify_album.released,
- :spotify_uri => @spotify_uri
- -
- )
- if @album.save
- diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb
- index a0308d7..46ae305 100644
- --- a/app/views/albums/show.html.erb
- +++ b/app/views/albums/show.html.erb
- @@ -19,8 +19,9 @@
- <a href="<%= @album.spotify_uri %>">Afspil</a>
- </p>
- +
- <% @tracks.each do |track| %>
- - <%= @track %><br /><br />
- + <%= track.name %></br>
- <% end %>
- <%= link_to 'Edit', edit_album_path(@album) %> |
- diff --git a/test/functional/albums_controller_test.rb b/test/functional/albums_controller_test.rb
- index d236cdc..591fea6 100644
- --- a/test/functional/albums_controller_test.rb
- +++ b/test/functional/albums_controller_test.rb
- @@ -2,7 +2,7 @@ require 'test_helper'
- class AlbumsControllerTest < ActionController::TestCase
- setup do
- - @album = albums(:one)
- + @album = Album.create(:spotify_uri => "spotify:album:2A0S2YIT08e4k52C4I8yfL")
- end
- test "should get index" do
- @@ -26,6 +26,9 @@ class AlbumsControllerTest < ActionController::TestCase
- test "should show album" do
- get :show, :id => @album.to_param
- +
- + tracks = assigns(:tracks)
- + ap tracks.first.name
- assert_response :success
- end
Add Comment
Please, Sign In to add comment