+
+
+
+
+ test "index without user" do
+ get :index
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "new without user" do
+ get :new
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "create line_item without user" do
+ post :create, :line_item => { :order_id => 1, :product_id => 1, :quantity => 5, :total_price => 9.99 }
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "show line_item without user" do
+ get :show, :id => line_items(:one).id
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "get edit without user" do
+ get :edit, :id => line_items(:one).id
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "update line_item without user" do
+ put :update, :id => line_items(:one).id, :line_item => { }
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+
+ test "destroy line_item without user" do
+ delete :destroy, :id => line_items(:one).id
+ assert_redirected_to :controller => "admin", :action => "login"
+ assert_equal "Please log in", flash[:notice]
+ end
+