Sha256: eaf876b85b6bdd230470f2a9a9474f13248a48ae0bfab9cb1044272da2bc7076

Contents?: true

Size: 1.1 KB

Versions: 12

Compression:

Stored size: 1.1 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe SettingsController do
  include SocialStream::TestHelpers
  render_views

  before do
    @user = Factory(:user)
    @actor = @user.actor
    sign_in @user
  end

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

  it "should render index after update_all" do
    put :update_all
    response.should redirect_to settings_path
  end

  describe "Notification settings" do
    it "update notification email settings to Never" do
      @actor.update_attributes(:notify_by_email => true)
      @actor.notify_by_email.should==true
      put :update_all, :settings_section => "notifications", :notify_by_email => "never"
      @actor.reload
      @actor.notify_by_email.should==false

    end

    it "update notification email settings to Always" do
      @actor.update_attributes(:notify_by_email => false)
      @actor.notify_by_email.should==false
      put :update_all, :settings_section => "notifications", :notify_by_email => "always"
      @actor.reload
      @actor.notify_by_email.should==true
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
social_stream-base-0.9.5 spec/controllers/settings_controller_spec.rb
social_stream-base-0.9.4 spec/controllers/settings_controller_spec.rb
social_stream-base-0.9.3 spec/controllers/settings_controller_spec.rb
social_stream-base-0.9.2 spec/controllers/settings_controller_spec.rb
social_stream-base-0.9.1 spec/controllers/settings_controller_spec.rb
social_stream-base-0.9.0 spec/controllers/settings_controller_spec.rb
social_stream-base-0.8.2 spec/controllers/settings_controller_spec.rb
social_stream-base-0.8.1 spec/controllers/settings_controller_spec.rb
social_stream-base-0.8.0 spec/controllers/settings_controller_spec.rb
social_stream-base-0.7.11 spec/controllers/settings_controller_spec.rb
social_stream-base-0.7.10 spec/controllers/settings_controller_spec.rb
social_stream-base-0.7.9 spec/controllers/settings_controller_spec.rb