require "test_helper" class PostsControllerTest < ActionController::TestCase test "renders default view" do get :index assert_equal [], assigns(:posts) assert_template "posts/index$" end test "renders overlay view" do request.env["X-View-Variant"] = "overlay" get :index assert_equal [], assigns(:posts) assert_template "posts/index.overlay$" end test "renders fashion view" do request.env["X-View-Variant"] = "fashion" get :index assert_equal [], assigns(:posts) assert_template "posts/index.fashion$" end end