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:
parent
3d9ecb4dd1
commit
9ff3c316b0
1 changed files with 132 additions and 131 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue