Improve layout flow / tests

This commit is contained in:
Andrew Tomaka 2014-02-15 01:46:22 -05:00
parent 9d2afc431a
commit 1b7268f456
4 changed files with 22 additions and 5 deletions

View file

@ -17,9 +17,7 @@
</div> </div>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li> <li><%= link_to 'Create Paste', new_paste_path %></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul> </ul>
</div> </div>
</nav> </nav>

View file

@ -1,3 +1,4 @@
<h2>Pastes</h2>
<% @pastes.each do |paste| %> <% @pastes.each do |paste| %>
<%= link_to paste.id, paste %><br /> <%= link_to paste.created_at, paste %><br />
<% end %> <% end %>

View file

@ -1 +1,3 @@
<pre class="prettyprint linenums">
<%= @paste.content %> <%= @paste.content %>
</pre>

View file

@ -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