Files
danbooru/test/functional/explore/posts_controller_test.rb
evazion 34337b0eb5 popular posts: fix exception when given blank date param.
Flexbooru calls this endpoint with a blank date param.
2020-03-31 21:57:34 -05:00

47 lines
1.0 KiB
Ruby

require "test_helper"
module Explore
class PostsControllerTest < ActionDispatch::IntegrationTest
context "in all cases" do
setup do
@post = create(:post)
end
context "#popular" do
should "render" do
get popular_explore_posts_path
assert_response :success
end
should "work with a blank date" do
get popular_explore_posts_path(date: "")
assert_response :success
end
end
context "#curated" do
should "render" do
@builder = create(:builder_user)
@post.add_favorite!(@builder)
get curated_explore_posts_path
assert_response :success
end
end
context "#searches" do
should "render" do
get searches_explore_posts_path
assert_response :success
end
end
context "#missed_searches" do
should "render" do
get missed_searches_explore_posts_path
assert_response :success
end
end
end
end
end