1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

run sinatra_helpers_spec only if Sinatra is loaded

This commit is contained in:
Akira Matsuda 2012-05-23 06:46:01 +09:00
parent 3d9ecb4dd1
commit 9ff3c316b0

View file

@ -1,29 +1,29 @@
require 'spec_helper'
require 'spec_helper_for_sinatra'
ERB_TEMPLATE_FOR_PAGINATE = <<EOT
<div>
<ul>
<% @users.each do |user| %>
if defined? Sinatra
ERB_TEMPLATE_FOR_PAGINATE = <<EOT
<div>
<ul>
<% @users.each do |user| %>
<li class="user_info"><%= user.id %></li>
<% end %>
</ul>
<%= paginate @users, @options %>
</div>
<% end %>
</ul>
<%= paginate @users, @options %>
</div>
EOT
ERB_TEMPLATE_FOR_NEXT_PAGE = <<EOT
<div>
<ul>
<% @users.each do |user| %>
ERB_TEMPLATE_FOR_NEXT_PAGE = <<EOT
<div>
<ul>
<% @users.each do |user| %>
<li class="user_info"><%= user.id %></li>
<% end %>
</ul>
<%= link_to_next_page(@users, "Next!", {:id => 'next_page_link'}.merge(@options || {})) %>
</div>
<% end %>
</ul>
<%= link_to_next_page(@users, "Next!", {:id => 'next_page_link'}.merge(@options || {})) %>
</div>
EOT
describe 'Kaminari::Helpers::SinatraHelper' do
describe 'Kaminari::Helpers::SinatraHelper' do
before do
50.times {|i| User.create! :name => "user#{i}"}
end
@ -166,4 +166,5 @@ describe 'Kaminari::Helpers::SinatraHelper' do
end
end
end
end
end