Sha256: 88d4143c4934bc3152f6d82dc517962a13a16a8d316009a9b1a481b98d0a1b35

Contents?: true

Size: 1.18 KB

Versions: 206

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'


describe NotificationsController do
  include SocialStream::TestHelpers
  render_views

  before do
    @user = Factory(:user)
    @actor =  @user.actor
    sign_in @user
    @receipt = @user.notify("subject", "body", Factory(:activity))
  end

  it "should render index" do
    get :index
    assert_response :success
  end

  it "should update read" do
    put :update, :id => @receipt.notification.to_param, :read => "Read"
    @receipt.notification.is_unread?(@actor).should==false
    assert_response :success
  end

  it "should update unread" do
    put :update, :id => @receipt.notification.to_param, :read => "Unread"
    @receipt.notification.is_unread?(@actor).should==true
    assert_response :success
  end

  it "should update all" do
    @receipt2 = @user.notify("subject", "body", Factory(:activity))
    put :update_all
    @receipt.notification.is_unread?(@actor).should==false
    @receipt2.notification.is_unread?(@actor).should==false
    assert_response :success
  end
  
  it "should send to trash" do
    delete :destroy, :id => @receipt.notification.to_param
    @receipt.notification.is_trashed?(@actor).should==true
    assert_response :success
  end

end

Version data entries

206 entries across 206 versions & 4 rubygems

Version Path
social_stream-1.1.12 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.11 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.11 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.10 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.10 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.9 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.9 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.8 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.8 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.7 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.7 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.6 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.6 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.5 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.5 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.4 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.4 base/spec/controllers/notifications_controller_spec.rb
social_stream-1.1.3 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-1.1.3 spec/controllers/notifications_controller_spec.rb
social_stream-1.1.2 base/spec/controllers/notifications_controller_spec.rb