OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
replace meeting cukes by feature specs
ulferts7c76eb9cce68
diff --git a/modules/meeting/features/meeting_participants.feature b/modules/meeting/features/meeting_participants.featuredeleted file mode 100644index b15505cfca0..00000000000--- a/modules/meeting/features/meeting_participants.feature+++ /dev/null@@ -1,58 +0,0 @@-#-- 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.-#++--Feature: Meeting has participants-- Background:- Given there is 1 project with the following:- | identifier | dingens |- | name | dingens |- And the project "dingens" uses the following modules:- | meetings |- And there is 1 user with:- | login | alice |- | firstname | Alice |- | lastname | Alice |- | language | en |- And there is 1 user with:- | login | bob |- | firstname | Bob |- | lastname | Bobbit |- | language | en |- And there is a role "meeting_viewer"- And there is a role "meeting_editor"- And the role "meeting_viewer" may have the following rights:- | view_meetings |- And the role "meeting_editor" may have the following rights:- | view_meetings |- | edit_meetings |- And the user "bob" is a "meeting_editor" in the project "dingens"- And there is 1 meeting in project "dingens" created by "bob" with:- | title | Bobs Meeting |- Given I am already logged in as "bob"-- Scenario: Users not allowed to view meetings are no valid participants- When I go to the edit page of the meeting called "Bobs Meeting"- Then the user "alice" should not be available as a participant-- Scenario: Users allowed to view meetings are valid participants- Given the user "alice" is a "meeting_viewer" in the project "dingens"- When I go to the edit page of the meeting called "Bobs Meeting"- Then the user "alice" should be available as a participantdiff --git a/modules/meeting/features/meeting_update.feature b/modules/meeting/features/meeting_update.featuredeleted file mode 100644index 6d625aca0ff..00000000000--- a/modules/meeting/features/meeting_update.feature+++ /dev/null@@ -1,68 +0,0 @@-#-- 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.-#++--Feature: Updating meetings-- Background:- Given there is 1 project with the following:- | name | worlddomination |- And the project "worlddomination" uses the following modules:- | meetings |- And there is a role "user"- And the role "user" may have the following rights:- | view_meetings |- | edit_meetings |- And there is 1 user with:- | login | alice |- | firstname | alice |- | lastname | alice |- And there is 1 user with:- | login | bob |- | firstname | bob |- | lastname | bobbit |- And there is 1 user with:- | login | chuck |- | firstname | chuck |- | lastname | testa |- And the user "alice" is a "user" in the project "worlddomination"- And the user "bob" is a "user" in the project "worlddomination"- And the user "chuck" is a "user" in the project "worlddomination"- And there is 1 meeting in project "worlddomination" created by "alice" with:- | title | Meeting 1 |- | location | Room 1 |- | duration | 1:30 |- | start_time | 2011-02-11 12:30:00 |- And "bob" is invited to the Meeting "Meeting 1"-- Scenario: Adding a new invitee- When I am already logged in as "alice"- And I go to the edit page of the meeting called "Meeting 1"- And I check "chuck testa invited"- And I click on "Save"- Then I should see "Successful update."- And I should see "chuck testa"-- Scenario: Removing an invitee- When I am already logged in as "alice"- And I go to the edit page of the meeting called "Meeting 1"- And I uncheck "bob bobbit invited"- And I click on "Save"- Then I should see "Successful update."- And I should not see "bob bobbit"diff --git a/modules/meeting/spec/features/meetings_participants_spec.rb b/modules/meeting/spec/features/meetings_participants_spec.rbnew file mode 100644index 00000000000..19859039018--- /dev/null+++ b/modules/meeting/spec/features/meetings_participants_spec.rb@@ -0,0 +1,84 @@+#-- copyright+# OpenProject is a project management system.+# Copyright (C) 2012-2015 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'++require_relative '../support/pages/meetings/edit'++describe 'Meetings participants', type: :feature do+ let(:project) { FactoryBot.create :project, enabled_module_names: %w[meetings] }+ let!(:user) do+ FactoryBot.create(:user,+ firstname: 'Current',+ member_in_project: project,+ member_with_permissions: %i[view_meetings edit_meetings])+ end+ let!(:viewer_user) do+ FactoryBot.create(:user,+ firstname: 'Viewer',+ member_in_project: project,+ member_with_permissions: %i[view_meetings])+ end+ let!(:non_viewer_user) do+ FactoryBot.create(:user,+ firstname: 'Nonviewer',+ member_in_project: project,+ member_with_permissions: %i[])+ end+ let(:meeting) { FactoryBot.create(:meeting, project: project) }+ let(:edit_page) { Pages::Meetings::Edit.new(meeting) }++ let!(:meeting) { FactoryBot.create :meeting, project: project, title: 'Awesome meeting!' }++ before do+ login_as(user)+ end++ it 'allows setting members to participants which are allowed to view the meeting' do+ edit_page.visit!++ edit_page.expect_available_participant(user)+ edit_page.expect_available_participant(viewer_user)++ edit_page.expect_not_available_participant(non_viewer_user)++ edit_page.invite(viewer_user)+ show_page = edit_page.click_save+ show_page.expect_notification(message: 'Successful update')++ show_page.expect_invited(viewer_user)++ show_page.click_edit++ edit_page.uninvite(viewer_user)+ show_page = edit_page.click_save+ show_page.expect_notification(message: 'Successful update')++ show_page.expect_uninvited(viewer_user)+ end+enddiff --git a/modules/meeting/spec/support/pages/meetings/edit.rb b/modules/meeting/spec/support/pages/meetings/edit.rbnew file mode 100644index 00000000000..84dcec2ebfc--- /dev/null+++ b/modules/meeting/spec/support/pages/meetings/edit.rb@@ -0,0 +1,68 @@+#-- copyright+# OpenProject is a project management system.+# Copyright (C) 2012-2018 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-2017 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 docs/COPYRIGHT.rdoc for more details.+#++++require_relative './base'+require_relative './show'++module Pages::Meetings+ class Edit < Base+ attr_accessor :meeting++ def initialize(meeting)+ self.meeting = meeting+ end++ def expect_available_participant(user)+ expect(page)+ .to have_field("#{user} invited")+ end++ def expect_not_available_participant(user)+ expect(page)+ .to have_no_field("#{user} invited")+ end++ def invite(user)+ check("#{user} invited")+ end++ def uninvite(user)+ uncheck("#{user} invited")+ end++ def click_save+ click_button('Save')++ Pages::Meetings::Show.new(meeting)+ end++ def path+ edit_meeting_path(meeting)+ end+ end+enddiff --git a/modules/meeting/spec/support/pages/meetings/show.rb b/modules/meeting/spec/support/pages/meetings/show.rbindex e7d9db3b51a..b2a7b4fade8 100644--- a/modules/meeting/spec/support/pages/meetings/show.rb+++ b/modules/meeting/spec/support/pages/meetings/show.rb@@ -47,7 +47,21 @@ module Pages::Meetingsenddef expect_invited(*users)- users.map(&:name).sort.join('; ')+ users.each do |user|+ within(".meeting.details") do+ expect(page)+ .to have_link(user.name)+ end+ end+ end++ def expect_uninvited(*users)+ users.each do |user|+ within(".meeting.details") do+ expect(page)+ .to have_no_link(user.name)+ end+ endenddef expect_date_time(expected)@@ -55,6 +69,12 @@ module Pages::Meetings.to have_content("Time: #{expected}")end+ def click_edit+ within '.meeting--main-toolbar .toolbar-items' do+ click_link 'Edit'+ end+ end+def pathmeeting_path(meeting)end