X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/eab2eeaa47b2aa8c7f52371f9bfdd60711a41fb6..250bb47cc2723c7af6fac0a6e9e900c1a50f9292:/test/controllers/user_blocks_controller_test.rb diff --git a/test/controllers/user_blocks_controller_test.rb b/test/controllers/user_blocks_controller_test.rb index ffb5744ea..717f1167a 100644 --- a/test/controllers/user_blocks_controller_test.rb +++ b/test/controllers/user_blocks_controller_test.rb @@ -223,9 +223,10 @@ class UserBlocksControllerTest < ActionController::TestCase :user_block_period => "12", :user_block => { :needs_view => false, :reason => "Vandalism" } end - assert_redirected_to user_block_path(:id => 4) + id = UserBlock.order(:id).ids.last + assert_redirected_to user_block_path(:id => id) assert_equal "Created a block on user #{users(:unblocked_user).display_name}.", flash[:notice] - b = UserBlock.find(4) + b = UserBlock.find(id) assert_in_delta Time.now, b.created_at, 1 assert_in_delta Time.now, b.updated_at, 1 assert_in_delta Time.now + 12.hour, b.ends_at, 1