root/extensions/agile_pm/spec/views/stories/backlog.html.erb_spec.rb

Download in other formats: Raw | Text
Revisions
Dimitrij Denissenko
Dimitrij Denissenko
Sep 12 2009 * 10:58
(12 months ago)

Revision c6ea8aef0cef1ec0ec0dc42a0c5d2972b6fbfaf1

Merge AgilePM into the main distribution Fixed AgilePM permission for Backlog viewing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe "/stories/backlog.html.erb" do
  
  before(:each) do
    @project = mock_current_project!        

    @stories = [stub_model(Story), stub_model(Story), stub_model(Story)]
    @stories.stub!(:active_count).and_return(1)
    @stories.stub!(:pending_count).and_return(1)
    @stories.stub!(:completed_count).and_return(1)
    @stories.stub!(:by_status).and_return(@stories)
    
    @sprint  = assigns[:sprint] = stub_model(Sprint, :title => 'Sprint 1', :stories => @stories, :starts_on => 10.days.ago.to_date, :finishes_on => 4.days.from_now.to_date)
    @milestone = assigns[:milestone] = stub_model(Milestone, :sprints => [@sprint, stub_model(Sprint, :title => 'Sprint 2')])    
    
    template.stub!(:permitted?).and_return(true)
    template.stub!(:x_stylesheet_link_tag)
    template.stub!(:stories_path).and_return('/path/to/stories')
  end

  it "should render the backlog" do
    render
    response.should have_tag '.agile-pm table.backlog', 1
  end
  
end