Merge pull request #54 from finnlabs/hotfix/15176_internal_error_clicking_on_preview_for_agenda_or_minutes
[Hotfix] 15176 internal error clicking on preview for agenda or minutespull/6827/head
commit
829a0958d8
@ -0,0 +1,41 @@ |
|||||||
|
#-- copyright |
||||||
|
# OpenProject Meeting 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. |
||||||
|
#++ |
||||||
|
|
||||||
|
require File.dirname(__FILE__) + '/../spec_helper' |
||||||
|
|
||||||
|
describe MeetingAgendasController do |
||||||
|
let(:meeting) { FactoryGirl.create(:meeting) } |
||||||
|
let(:user) { FactoryGirl.create(:admin) } |
||||||
|
|
||||||
|
before { User.stub(:current).and_return(user) } |
||||||
|
|
||||||
|
describe 'preview' do |
||||||
|
let(:text) { "Meeting agenda content" } |
||||||
|
|
||||||
|
it_behaves_like 'valid preview' do |
||||||
|
let(:preview_texts) { [text] } |
||||||
|
let(:preview_params) { { meeting_id: meeting.id, meeting_agenda: { text: text } } } |
||||||
|
end |
||||||
|
|
||||||
|
it_behaves_like 'authorizes object access' do |
||||||
|
let(:preview_params) { { meeting_id: meeting.id, meeting_agenda: { } } } |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,43 @@ |
|||||||
|
#-- copyright |
||||||
|
# OpenProject Meeting 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. |
||||||
|
#++ |
||||||
|
|
||||||
|
require File.dirname(__FILE__) + '/../spec_helper' |
||||||
|
|
||||||
|
describe MeetingMinutesController do |
||||||
|
let(:meeting) { FactoryGirl.create(:meeting) } |
||||||
|
let(:user) { FactoryGirl.create(:admin) } |
||||||
|
|
||||||
|
before { User.stub(:current).and_return(user) } |
||||||
|
|
||||||
|
describe 'preview' do |
||||||
|
let(:text) { "Meeting minutes content" } |
||||||
|
|
||||||
|
before { MeetingMinutes.any_instance.stub(:editable?).and_return(true) } |
||||||
|
|
||||||
|
it_behaves_like 'valid preview' do |
||||||
|
let(:preview_texts) { [text] } |
||||||
|
let(:preview_params) { { meeting_id: meeting.id, meeting_minutes: { text: text } } } |
||||||
|
end |
||||||
|
|
||||||
|
it_behaves_like 'authorizes object access' do |
||||||
|
let(:preview_params) { { meeting_id: meeting.id, meeting_minutes: { } } } |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,43 @@ |
|||||||
|
#-- copyright |
||||||
|
# OpenProject is a project management system. |
||||||
|
# Copyright (C) 2012-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. |
||||||
|
# |
||||||
|
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||||
|
# Copyright (C) 2006-2013 Jean-Philippe Lang |
||||||
|
# Copyright (C) 2010-2013 the ChiliProject Team |
||||||
|
# |
||||||
|
# This program is free software; you can redistribute it and/or |
||||||
|
# modify it under the terms of the GNU General Public License |
||||||
|
# as published by the Free Software Foundation; either version 2 |
||||||
|
# of the License, or (at your option) any later version. |
||||||
|
# |
||||||
|
# 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.rdoc for more details. |
||||||
|
#++ |
||||||
|
|
||||||
|
require 'spec_helper' |
||||||
|
|
||||||
|
describe 'preview' do |
||||||
|
it "should connect POST /meetings/:meeting_id/agenda/preview to meeting_agendas#preview" do |
||||||
|
expect(post("/meetings/1/agenda/preview")).to route_to(controller: 'meeting_agendas', |
||||||
|
meeting_id: '1', |
||||||
|
action: 'preview') |
||||||
|
end |
||||||
|
|
||||||
|
it "should connect POST /meetings/:meeting_id/agenda/preview to meeting_minutes#preview" do |
||||||
|
expect(post("/meetings/1/minutes/preview")).to route_to(controller: 'meeting_minutes', |
||||||
|
meeting_id: '1', |
||||||
|
action: 'preview') |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue