Skip to content

Commit

Permalink
small spec performance tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bbenezech committed Dec 24, 2012
1 parent 94a5967 commit 94f5c20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/integration/basic/list/rails_admin_basic_list_spec.rb
Expand Up @@ -30,7 +30,8 @@

describe "GET /admin/player as list" do
it "shows \"List of Models\", should show filters and should show column headers" do
21.times { FactoryGirl.create :player } # two pages of players
RailsAdmin.config.default_items_per_page = 1
2.times { FactoryGirl.create :player } # two pages of players
visit index_path(:model_name => "player")
should have_content("List of Players")
should have_content("Created at")
Expand Down Expand Up @@ -295,19 +296,20 @@
end
end

describe "GET /admin/player with 20 objects" do
describe "GET /admin/player with 2 objects" do
before(:each) do
@players = 20.times.map { FactoryGirl.create :player }
@players = 2.times.map { FactoryGirl.create :player }
visit index_path(:model_name => "player")
end

it "shows \"20 results\"" do
should have_content("20 players")
it "shows \"2 results\"" do
should have_content("2 players")
end
end

describe "GET /admin/player with 3 pages, page 2" do
before(:each) do
before do
RailsAdmin.config.default_items_per_page = 1
items_per_page = RailsAdmin.config.default_items_per_page
(items_per_page * 3).times { FactoryGirl.create(:player) }
visit index_path(:model_name => "player", :page => 2)
Expand Down
2 changes: 2 additions & 0 deletions spec/integration/rails_admin_spec.rb
Expand Up @@ -8,6 +8,7 @@
it "is disableable" do
logout
RailsAdmin.config do |config|
config.included_models = []
config.authenticate_with {}
end
visit dashboard_path
Expand All @@ -19,6 +20,7 @@
# file as template for a new translation).
describe "localization" do
it "defaults to English" do
RailsAdmin.config.included_models = []
visit dashboard_path

should have_content("Site administration")
Expand Down

0 comments on commit 94f5c20

Please sign in to comment.