+ post diary_entry_subscribe_path(user, diary_entry)
+ end
+ end
+
+ def test_unsubscribe_page
+ user = create(:user)
+ other_user = create(:user)
+ diary_entry = create(:diary_entry, :user => user)
+ path = diary_entry_unsubscribe_path(user, diary_entry)
+
+ get path
+ assert_redirected_to login_path(:referer => path)
+
+ session_for(other_user)
+ get path
+ assert_response :success
+ assert_dom ".content-body" do
+ assert_dom "a[href='#{diary_entry_path(user, diary_entry)}']", :text => diary_entry.title
+ assert_dom "a[href='#{user_path(user)}']", :text => user.display_name