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.12.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.12.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.12.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.11.5 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.11.3 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.11.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.7 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.6 spec/views/accounts/_account.html.erb_spec.rb
saasy-0.0.2.alpha3 spec/views/accounts/_account.html.erb_spec.rb
saasy-0.0.2.alpha2 spec/views/accounts/_account.html.erb_spec.rb
saasy-0.0.2.alpha1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.5 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.4 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.3 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.2 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.10.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.9.1 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.9.0 spec/views/accounts/_account.html.erb_spec.rb
saucy-0.8.5 spec/views/accounts/_account.html.erb_spec.rb