diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b97625a..23a61f0 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,9 +17,7 @@ diff --git a/app/views/pastes/index.html.erb b/app/views/pastes/index.html.erb index 91d18f3..d45f3b7 100644 --- a/app/views/pastes/index.html.erb +++ b/app/views/pastes/index.html.erb @@ -1,3 +1,4 @@ +

Pastes

<% @pastes.each do |paste| %> - <%= link_to paste.id, paste %>
+ <%= link_to paste.created_at, paste %>
<% end %> diff --git a/app/views/pastes/show.html.erb b/app/views/pastes/show.html.erb index b8088ab..49d9a74 100644 --- a/app/views/pastes/show.html.erb +++ b/app/views/pastes/show.html.erb @@ -1 +1,3 @@ -<%= @paste.content %> +
+  <%= @paste.content %>
+
diff --git a/spec/features/lists_pastes_spec.rb b/spec/features/lists_pastes_spec.rb new file mode 100644 index 0000000..55a04ff --- /dev/null +++ b/spec/features/lists_pastes_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +feature 'Lists pastes' do + let(:paste) { FactoryGirl.create(:paste) } + before do + visit new_paste_path + fill_in 'Content', with: paste.content + click_button 'Paste it!' + visit pastes_path + end + subject { page } + + scenario 'shows paste on index' do + should have_content(paste.created_at) + end +end