Sha256: 02af360d7ff3de3a81f3ae82b3419cd8b857bed8978b8789114b411f14126608

Contents?: true

Size: 937 Bytes

Versions: 82

Compression:

Stored size: 937 Bytes

Contents

require 'spec_helper'

describe "/accounts/_account.html.erb" do
  let(:account) { Factory.stub(:account) }
  let(:edit_link) { %{href="#{edit_account_path(account)}"} }
  let(:user) { Factory.stub(:user) }

  before { view.stubs(:current_user => user) }

  def render_account
    render :partial => "accounts/account",
           :locals  => { :account => account, :projects => projects }
  end

  context "with projects" do
    let(:project) { Factory.stub(:project, :name => 'Test Project') }
    let(:projects) { [project] }
    before { render_account }

    it "renders projects" do
      rendered.should include(project.name)
    end

    it "doesn't render the blank slate" do
      rendered.should_not include("blank_slate")
    end
  end

  context "without projects" do
    let(:projects) { [] }
    before { render_account }

    it "renders the blank slate" do
      rendered.should include("blank_slate")
    end
  end
end

Version data entries

82 entries across 82 versions & 2 rubygems

Version Path
saucy-0.8.4 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.8.3 spec/views/accounts/_account.html.erb_spec.rb
saasy-0.0.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.8.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.8.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.8.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.7.3 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.7.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.7.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.7.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.6.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.6.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.5 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.4 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.3 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.5.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.4.10 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.4.9 spec/views/accounts/_account.html.erb_spec.rb