Sha256: cff8ad83d96a48146d62f547f6a6e99c813a5cc32117d7485b87a3ed2780424f

Contents?: true

Size: 891 Bytes

Versions: 22

Compression:

Stored size: 891 Bytes

Contents

require 'spec_helper'

describe 'settings/_index' do
  let(:user) { stub_model(User, { name: "Test User",
                                  email: "test-user@test.com",
                                  language: 'en' } ) }

  let(:group) { stub_model(Group, { name: "Test Group",
                                    to_param: "test-group" } ) }

  before do
    SocialStream::Presence.stub(:enable) { true }

    view.stub(:current_user).and_return(user)
  end

  describe "with user" do
    before do
      view.stub(:current_subject).and_return(user)
    end

    it "includes chat settings" do
      render

      rendered.should =~ /chat_settings/
    end
  end

  describe "with group" do
    before do
      view.stub(:current_subject).and_return(group)
    end

    it "does not include chat settings" do
      render

      rendered.should_not =~ /chat_settings/
    end
  end

end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
social_stream-2.2.2 presence/spec/views/settings_spec.rb
social_stream-presence-2.2.1 spec/views/settings_spec.rb
social_stream-2.2.1 presence/spec/views/settings_spec.rb
social_stream-2.2.0 presence/spec/views/settings_spec.rb
social_stream-presence-2.2.0 spec/views/settings_spec.rb
social_stream-2.1.1 presence/spec/views/settings_spec.rb
social_stream-2.1.0 presence/spec/views/settings_spec.rb
social_stream-presence-2.1.0 spec/views/settings_spec.rb
social_stream-2.0.4 presence/spec/views/settings_spec.rb
social_stream-presence-2.0.2 spec/views/settings_spec.rb
social_stream-2.0.3 presence/spec/views/settings_spec.rb
social_stream-2.0.2 presence/spec/views/settings_spec.rb
social_stream-presence-2.0.1 spec/views/settings_spec.rb
social_stream-2.0.1 presence/spec/views/settings_spec.rb
social_stream-2.0.0 presence/spec/views/settings_spec.rb
social_stream-presence-2.0.0 spec/views/settings_spec.rb
social_stream-2.0.0.beta3 presence/spec/views/settings_spec.rb
social_stream-presence-2.0.0.beta3 spec/views/settings_spec.rb
social_stream-2.0.0.beta2 presence/spec/views/settings_spec.rb
social_stream-presence-2.0.0.beta2 spec/views/settings_spec.rb