railsspace building a social networking website with ruby on rails phần 9

đăng nhập như @ người bạn và có được chấp nhận for@ hành động. Kiểm tra sau đó xác minh tin nhắn nhấp nháy thích hợp và chuyển hướng cho mỗi hành động: Đăng nhập như là người dùng và gửi yêu cả các ý kiến một lần nữa. Một khả năng thứ hai | Simpo PDF Merge and Split Unregistered Version - http 434 Chapter 14 Friendships Figure A user profile with friend listing. log in as friend and get the accept action for @. The test then verifies the proper flash message and redirect for each action Listing test functional require FILE__ . test_helper require friendship_controller Re-raise errors caught by the controller. class Friendshipcontroller def rescue_action e raise e end end class FriendshipControllerTest Test Unit TestCase include ProfileHelper fixtures users specs def setup controller request ActionController response ActionController user users valid_user friend users friend Make sure deliveries aren t actually made ActionMailer test end def test_create Log in as user and send request. Simpo PDF Merge and Split Unregistered Version - http Managing friendships 435 authorize @user get create id @ assert_response redirect assert_redirected_to profile_for @friend assert_equal Friend request sent. flash notice Log in as friend and accept request. authorize friend get accept id @ assert_redirected_to hub_url assert_equal Friendship with @ accepted flash notice end end Running this gives ruby test functional Loaded suite test functional friendship_controller_test Started . Finished in seconds. 1 tests 5 assertions 0 failures 0 errors Simpo PDF Merge and Split Unregistered Version - http This page intentionally left .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.