OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/controllers/my_projects_overview_contro...

66 lines
1.8 KiB

#-- copyright
# OpenProject My Project Page Plugin
#
# Copyright (C) 2011-2014 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.md for more details.
#++
13 years ago
require File.dirname(__FILE__) + '/../spec_helper'
describe MyProjectsOverviewsController, :type => :controller do
13 years ago
before :each do
allow(@controller).to receive(:set_localization)
expect(@controller).to receive(:authorize)
13 years ago
@role = FactoryGirl.create(:non_member)
@user = FactoryGirl.create(:admin)
13 years ago
allow(User).to receive(:current).and_return @user
13 years ago
@params = {}
end
let(:project) { FactoryGirl.create(:project) }
13 years ago
describe 'index' do
let(:params) { { "id" => project.id.to_s } }
describe "WHEN calling the page" do
render_views
before do
get 'index', params
end
13 years ago
it 'renders the overview page' do
expect(response).to be_success
expect(response).to render_template 'index'
end
13 years ago
end
describe "WHEN calling the page
WHEN providing a jump parameter" do
before do
params["jump"] = "work_packages"
get 'index', params
end
it { expect(response).to redirect_to project_work_packages_path(project) }
13 years ago
end
end
end