Sha256: 4843b0cc1f0e7903a2b82743cb0aa90aef3b42477c1d5c320bd0d25ce30b4bf7

Contents?: true

Size: 1.2 KB

Versions: 25

Compression:

Stored size: 1.2 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
    response.should redirect_to(notifications_path)
  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

25 entries across 25 versions & 2 rubygems

Version Path
social_stream-2.2.2 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.2.2 spec/controllers/notifications_controller_spec.rb
social_stream-2.2.1 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.2.1 spec/controllers/notifications_controller_spec.rb
social_stream-2.2.0 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.2.0 spec/controllers/notifications_controller_spec.rb
social_stream-2.1.1 base/spec/controllers/notifications_controller_spec.rb
social_stream-2.1.0 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.1.0 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.4 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.0.4 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.3 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.0.3 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.2 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.0.2 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.1 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.0.1 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.0 base/spec/controllers/notifications_controller_spec.rb
social_stream-base-2.0.0 spec/controllers/notifications_controller_spec.rb
social_stream-2.0.0.beta3 base/spec/controllers/notifications_controller_spec.rb