Add spec ensuring that work_packages#index retrieves queries from session

pull/758/head
Till Breuer 11 years ago committed by Christian Ratz
parent a34a4f0e3e
commit d763278dde
  1. 23
      spec/controllers/work_packages_controller_spec.rb

@ -139,28 +139,37 @@ describe WorkPackagesController do
end
describe 'html' do
let(:call_action) { get('index', :project_id => project.id) }
before { call_action }
describe "w/o a project" do
let(:project) { nil }
let(:call_action) { get('index') }
it 'should render the index template' do
call_action
response.should render_template('work_packages/index', :formats => ["html"],
:layout => :base)
end
end
describe "w/ a project" do
let(:call_action) { get('index', :project_id => project.id) }
context "w/ a project" do
it 'should render the index template' do
call_action
response.should render_template('work_packages/index', :formats => ["html"],
:layout => :base)
end
end
context 'when a query has been previously selected' do
let(:query) do
FactoryGirl.build_stubbed(:query).tap {|q| q.filters = [Queries::WorkPackages::Filter.new('done_ratio', operator: ">=", values: [10]) ]}
end
before { session.stub(:query).and_return query }
it 'preserves the query' do
assigns['query'].filters.should == query.filters
end
end
end
describe 'csv' do

Loading…
Cancel
Save