mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Fix/remove cucumber (#8847)
* replace very last cuke with spec * remove cuke support files * remove cucumber gems * remove traces of cucumber * remove no longer required route * forcefully clear parallel_test features task * attempt removal of binstub * attempt to stabilize spec
This commit is contained in:
@@ -57,7 +57,6 @@ ratings:
|
||||
paths:
|
||||
- app/**
|
||||
- config/**
|
||||
- features/**
|
||||
- frontend/**
|
||||
- lib/**
|
||||
- spec/**
|
||||
|
||||
+1
-1
@@ -452,7 +452,7 @@ ij_json_spaces_within_braces = false
|
||||
ij_json_spaces_within_brackets = false
|
||||
ij_json_wrap_long_lines = false
|
||||
|
||||
[{rcov,spec,rake,cucumber,rails,spork,capfile,gemfile,rakefile,guardfile,isolate,vagrantfile,Puppetfile,*.jbuilder,*.rbw,*.gemspec,*.thor,*.ru,*.rb,*.rake}]
|
||||
[{rcov,spec,rake,rails,spork,capfile,gemfile,rakefile,guardfile,isolate,vagrantfile,Puppetfile,*.jbuilder,*.rbw,*.gemspec,*.thor,*.ru,*.rb,*.rake}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_continuation_indent_size = 2
|
||||
|
||||
+1
-2
@@ -91,11 +91,10 @@ jobs:
|
||||
- bash script/ci/runner.sh npm
|
||||
|
||||
- stage: test
|
||||
name: 'legacy specs + cukes (1/1)'
|
||||
name: 'legacy specs (1/1)'
|
||||
script:
|
||||
- bash script/ci/setup.sh spec_legacy
|
||||
- bash script/ci/runner.sh spec_legacy 1 1
|
||||
- bash script/ci/runner.sh plugins:cucumber 1 1
|
||||
- stage: test
|
||||
name: 'units (1/5)'
|
||||
script:
|
||||
|
||||
@@ -196,8 +196,6 @@ group :test do
|
||||
# and other niceties
|
||||
gem 'test-prof', '~> 0.12.0'
|
||||
|
||||
gem 'cucumber', '~> 3.1.0'
|
||||
gem 'cucumber-rails', '~> 1.8.0', require: false
|
||||
gem 'database_cleaner', '~> 1.8'
|
||||
gem 'rack_session_access'
|
||||
gem 'rspec', '~> 3.10.0'
|
||||
|
||||
@@ -306,7 +306,6 @@ GEM
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sigv4 (1.2.2)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
backports (3.18.2)
|
||||
bcrypt (3.1.16)
|
||||
bindata (2.4.8)
|
||||
binding_of_caller (0.8.0)
|
||||
@@ -366,28 +365,6 @@ GEM
|
||||
crass (1.0.6)
|
||||
crowdin-api (0.6.0)
|
||||
rest-client (~> 2.0)
|
||||
cucumber (3.1.2)
|
||||
builder (>= 2.1.2)
|
||||
cucumber-core (~> 3.2.0)
|
||||
cucumber-expressions (~> 6.0.1)
|
||||
cucumber-wire (~> 0.0.1)
|
||||
diff-lcs (~> 1.3)
|
||||
gherkin (~> 5.1.0)
|
||||
multi_json (>= 1.7.5, < 2.0)
|
||||
multi_test (>= 0.1.2)
|
||||
cucumber-core (3.2.1)
|
||||
backports (>= 3.8.0)
|
||||
cucumber-tag_expressions (~> 1.1.0)
|
||||
gherkin (~> 5.0)
|
||||
cucumber-expressions (6.0.1)
|
||||
cucumber-rails (1.8.0)
|
||||
capybara (>= 2.12, < 4)
|
||||
cucumber (>= 3.0.2, < 4)
|
||||
mime-types (>= 2.0, < 4)
|
||||
nokogiri (~> 1.8)
|
||||
railties (>= 4.2, < 7)
|
||||
cucumber-tag_expressions (1.1.1)
|
||||
cucumber-wire (0.0.1)
|
||||
daemons (1.3.1)
|
||||
dalli (2.7.11)
|
||||
danger (8.2.1)
|
||||
@@ -517,7 +494,6 @@ GEM
|
||||
ruby-progressbar (~> 1.4)
|
||||
get_process_mem (0.2.7)
|
||||
ffi (~> 1.0)
|
||||
gherkin (5.1.0)
|
||||
git (1.7.0)
|
||||
rchardet (~> 1.8)
|
||||
globalid (0.4.2)
|
||||
@@ -617,7 +593,6 @@ GEM
|
||||
mixlib-shellout (2.1.0)
|
||||
msgpack (1.3.3)
|
||||
multi_json (1.15.0)
|
||||
multi_test (0.1.2)
|
||||
multipart-post (2.1.1)
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
@@ -982,8 +957,6 @@ DEPENDENCIES
|
||||
commonmarker (~> 0.21.0)
|
||||
compare-xml (~> 0.66)
|
||||
costs!
|
||||
cucumber (~> 3.1.0)
|
||||
cucumber-rails (~> 1.8.0)
|
||||
daemons
|
||||
dalli (~> 2.7.10)
|
||||
danger (~> 8.2.0)
|
||||
|
||||
@@ -26,20 +26,6 @@
|
||||
# See docs/COPYRIGHT.rdoc for more details.
|
||||
#++
|
||||
|
||||
# :spork guard must come first
|
||||
# guard :spork, :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
|
||||
# watch('config/application.rb')
|
||||
# watch('config/environment.rb')
|
||||
# watch('config/environments/test.rb')
|
||||
# watch(%r{^config/initializers/.+\.rb$})
|
||||
# watch('Gemfile')
|
||||
# watch('Gemfile.lock')
|
||||
# watch('spec/spec_helper.rb') { :rspec }
|
||||
# watch(%r{^spec/support/.+\.rb$}) { :rspec }
|
||||
# watch('test/test_helper.rb') { :test }
|
||||
# watch(%r{features/support/}) { :cucumber }
|
||||
# end
|
||||
|
||||
guard :rspec do # , :cli => "--drb" do
|
||||
watch(%r{^spec/.+_spec\.rb$})
|
||||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
||||
@@ -60,21 +46,3 @@ guard :rspec do # , :cli => "--drb" do
|
||||
watch(%r{^spec/acceptance/(.+)\.feature$})
|
||||
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
||||
end
|
||||
|
||||
# guard :cucumber do # , :cli => "--drb" do
|
||||
# watch(%r{^features/.+\.feature$})
|
||||
# watch(%r{^features/support/.+$}) { 'features' }
|
||||
# watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
||||
# end
|
||||
|
||||
guard :test, all_on_start: false, all_after_pass: false do # , :drb => true do
|
||||
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
||||
watch(%r{^test/.+_test\.rb$})
|
||||
watch('test/test_helper.rb') { 'test' }
|
||||
|
||||
# Rails example
|
||||
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
|
||||
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
|
||||
watch(%r{^app/views/.+\.rb$}) { 'test/integration' }
|
||||
watch('app/controllers/application_controller.rb') { ['test/functional', 'test/integration'] }
|
||||
end
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Runs cucumber while requiring all plugin feature folders to
|
||||
# make sure all steps are defined. Using this you can then run
|
||||
# cucumber as usual, for instance to call a specific scenario:
|
||||
#
|
||||
# ./bin/cucumber `bundle show openproject-reporting`/features/links.feature:23
|
||||
FEATURES=`bundle exec rails runner "
|
||||
support_files = [Rails.root.join('features').to_s] +
|
||||
Plugins::LoadPathHelper
|
||||
.cucumber_load_paths
|
||||
.flat_map { |path| ['-r', Shellwords.escape(path)] }
|
||||
|
||||
puts support_files.join(' ')"`
|
||||
|
||||
bundle exec cucumber -r $FEATURES $*
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
<%
|
||||
rerun_file = "tmp/cucumber-rerun.txt"
|
||||
rerun = File.file?(rerun_file) ? IO.read(rerun_file) : ""
|
||||
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
||||
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --tags 'not @wip'"
|
||||
%>
|
||||
default: <%= std_opts %> features
|
||||
wip: --tags @wip:3 --wip features
|
||||
rerun: <%= rerun_opts %> --format rerun --out <%= rerun_file %> --tags 'not @wip'
|
||||
@@ -552,12 +552,6 @@ OpenProject::Application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
# This route should probably be removed, but it's used at least by one cuke and we don't
|
||||
# want to break it.
|
||||
# This route intentionally occurs after the admin/roles/new route, so that one takes
|
||||
# precedence when creating routes (possibly via helpers).
|
||||
get 'roles/new' => 'roles#new', as: 'deprecated_roles_new'
|
||||
|
||||
get '/robots' => 'homescreen#robots', defaults: { format: :txt }
|
||||
|
||||
root to: 'account#login'
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
bundle binstubs parallel_tests
|
||||
bundle exec rake db:migrate
|
||||
bundle exec rake i18n:js:export openproject:plugins:register_frontend assets:rebuild_manifest assets:clean
|
||||
cp -rp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json
|
||||
|
||||
@@ -54,9 +54,9 @@ You will be able to run failing tests locally in a similar fashion for all error
|
||||
|
||||
|
||||
|
||||
**Errors in the legacy specs + cukes group**
|
||||
**Errors in the legacy specs**
|
||||
|
||||
For the `legacy specs + cukes` job, please [see the section on running legacy tests](#legacy-tests).
|
||||
For the `legacy specs` job, please [see the section on running legacy specs](#legacy-specs).
|
||||
|
||||
|
||||
|
||||
@@ -239,12 +239,10 @@ You can run the specs with the following commands:
|
||||
|
||||
|
||||
|
||||
## Legacy tests
|
||||
## Legacy specs
|
||||
|
||||
**Note:** *We do not write new tests in this category. Tests are expected to be removed from these two groups whenever they break.*
|
||||
|
||||
### Legacy specs
|
||||
|
||||
The legacy specs use `minitest` and reside under `spec_legacy/` in the application root. No new tests are to be added here, but old ones removed whenever we refactor code.
|
||||
|
||||
To run all legacy specs, use this command:
|
||||
@@ -253,18 +251,6 @@ To run all legacy specs, use this command:
|
||||
RAILS_ENV=test bundle exec rake spec -I spec_legacy spec_legacy/
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Cucumber
|
||||
|
||||
Cucumber tests are behavior driven tests written in almost plain english. They are incredibly slow and have been almost completely removed from OpenProject with the exception of the legacy backlog plugin. You will likely not need to run these locally. If you need to, run the following command:
|
||||
|
||||
```bash
|
||||
RAILS_ENV=test sh ./script/ci/runner.sh plugins:cucumber 1 1
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Parallel testing
|
||||
|
||||
Running tests in parallel makes usage of all available cores of the machine.
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When(/^I activate activity filter "(.*?)"/) do |activity_type|
|
||||
id = "show_#{activity_type.parameterize.underscore.pluralize.to_sym}"
|
||||
|
||||
all(:xpath, "//input[@id='#{id}']").each do |checkbox|
|
||||
checkbox.set(true)
|
||||
end
|
||||
end
|
||||
@@ -1,72 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^I should see membership to the project "(.+)" with the roles:$/ do |project, roles_table|
|
||||
project = Project.like(project).first
|
||||
steps %{ Then I should see "#{project.name}" within "#tab-content-memberships .memberships" }
|
||||
tab = page.find('#tab-content-memberships .memberships')
|
||||
|
||||
roles_table.raw.flatten.each do |role_name|
|
||||
expect(tab.find('tr', text: project.name)).to have_selector('td.roles span', text: role_name)
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should not see membership to the project "(.+)"$/ do |project|
|
||||
project = Project.like(project).first
|
||||
begin
|
||||
page.find(:css, '#tab-content-memberships .memberships')
|
||||
steps %{ Then I should not see "#{project.name}" within "#tab-content-memberships .memberships" }
|
||||
rescue Capybara::ElementNotFound
|
||||
steps %{ Then I should see "This user is currently not a member of a project." within "#tab-content-memberships" }
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I check the role "([^"]+)"$/ do |role|
|
||||
role = Role.like(role).first
|
||||
steps %{And I check "membership_role_ids_#{role.id}"}
|
||||
end
|
||||
|
||||
When /^I delete membership to project "(.*?)"$/ do |project|
|
||||
project = Project.like(project).first
|
||||
page.find(:css, '#tab-content-memberships .memberships').find(:xpath, "//tr[contains(.,'#{project.name}')]").find(:css, '.icon-remove').click
|
||||
end
|
||||
|
||||
When /^I edit membership to project "(.*?)" to contain the roles:$/ do |project, roles_table|
|
||||
project = Project.like(project).first
|
||||
steps %{ Then I should see "#{project.name}" within "#tab-content-memberships .memberships" }
|
||||
|
||||
# Click 'Edit'
|
||||
page.find(:css, '#tab-content-memberships .memberships').find(:xpath, "//tr[contains(.,'#{project.name}')]").find(:css, '.icon-edit').click
|
||||
|
||||
roles_table.raw.flatten.map { |r| Role.like(r).first }.each do |role|
|
||||
checkbox = page.find(:css, '#tab-content-memberships .memberships').find(:xpath, "//tr[contains(.,'#{project.name}')]//input[@type='checkbox'][@value='#{role.id}']")
|
||||
checkbox.click unless checkbox.checked?
|
||||
end
|
||||
steps %{ And I click "Change" within "#tab-content-memberships .memberships" }
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^the breadcrumbs should (not )?have the element "(.+)"$/ do |negation, string|
|
||||
# find all descendants of an element with id 'breadcrumb' that have a child text node equalling
|
||||
# string
|
||||
selector = have_xpath("//*[@id='breadcrumb']//*[text()='#{string}']")
|
||||
if negation == 'not '
|
||||
should_not selector
|
||||
else
|
||||
should selector
|
||||
end
|
||||
end
|
||||
@@ -1,84 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# "Then I should see 5 articles"
|
||||
Then /^I should see (\d+) ([^\" ]+)?$/ do |number, name|
|
||||
page.should have_css(".#{name.singularize}", count: number.to_i)
|
||||
end
|
||||
|
||||
Then /^I should not see(?: (\d+))? ([^\" ]+)$/ do |number, name|
|
||||
options = number ? { count: number.to_i } : {}
|
||||
page.should have_no_css(".#{name.singularize}", options)
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]+?)")? uses the following types:$/ do |project, table|
|
||||
project = get_project(project)
|
||||
|
||||
types = table.raw.map { |line|
|
||||
name = line.first
|
||||
type = ::Type.find_by(name: name)
|
||||
|
||||
type = FactoryBot.create(:type, name: name) if type.blank?
|
||||
type
|
||||
}
|
||||
|
||||
project.update type_ids: types.map(&:id).map(&:to_s)
|
||||
end
|
||||
|
||||
Then(/^I should see the following fields:$/) do |table|
|
||||
table.raw.each do |field, value|
|
||||
# enforce matches including the value only if it is provided
|
||||
# i.e. the column in the table is created
|
||||
|
||||
if value
|
||||
|
||||
begin
|
||||
found = find_field(field)
|
||||
rescue Capybara::ElementNotFound
|
||||
raise Capybara::ExpectationNotMet, "expected to find field \"#{field}\" but there were no matches."
|
||||
end
|
||||
|
||||
if found.tag_name == 'select' && value.present?
|
||||
should have_select(field, selected: value)
|
||||
else
|
||||
found.value.should == value
|
||||
end
|
||||
else
|
||||
should have_field(field)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^"([^"]*)" should be the first row in table$/) do |name|
|
||||
should have_selector('table.generic-table tbody tr td', text: Regexp.new("#{name}"))
|
||||
end
|
||||
|
||||
When(/^I click link "(.*?)"$/) do |selector|
|
||||
page.find(:css, selector).click
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^I open the context menu on the work packages:$/ do |table|
|
||||
elements = []
|
||||
table.raw.flatten.each do |subject_or_id|
|
||||
wp = WorkPackage.find_by(subject: subject_or_id) || WorkPackage.find_by(id: subject_or_id)
|
||||
element = page.find(:xpath, "//body//div[@id='content']//tr[@id='wp-row-#{wp.id}']")
|
||||
element.click && elements << element
|
||||
end
|
||||
right_click(elements.first)
|
||||
end
|
||||
@@ -1,32 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^Delayed Job is turned off$/ do
|
||||
Delayed::Worker.delay_jobs = false
|
||||
end
|
||||
@@ -1,109 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
[CustomField, WorkPackageCustomField].each do |const|
|
||||
InstanceFinder.register(const, Proc.new { |name| const.find_by(name: name) })
|
||||
RouteMap.register(const, '/custom_fields')
|
||||
end
|
||||
|
||||
Given /^the following (user|issue|work package) custom fields are defined:$/ do |type, table|
|
||||
type = (type.gsub(' ', '_') + '_custom_field').to_sym
|
||||
|
||||
as_admin do
|
||||
table.hashes.each_with_index do |r, _i|
|
||||
attr_hash = { name: r['name'],
|
||||
field_format: r['type'] }
|
||||
|
||||
attr_hash[:possible_values] = r['possible_values'].split(',').map(&:strip) if r['possible_values']
|
||||
attr_hash[:is_required] = (r[:required] == 'true') if r[:required]
|
||||
attr_hash[:editable] = (r[:editable] == 'true') if r[:editable]
|
||||
attr_hash[:visible] = (r[:visible] == 'true') if r[:visible]
|
||||
attr_hash[:is_filter] = (r[:is_filter] == 'true') if r[:is_filter]
|
||||
attr_hash[:default_value] = r[:default_value] ? r[:default_value] : nil
|
||||
attr_hash[:is_for_all] = r[:is_for_all] || true
|
||||
|
||||
FactoryBot.create type, attr_hash
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the user "(.+?)" has the user custom field "(.+?)" set to "(.+?)"$/ do |login, field_name, value|
|
||||
user = User.find_by_login(login)
|
||||
custom_field = UserCustomField.find_by(name: field_name)
|
||||
|
||||
user.custom_values.build(custom_field: custom_field, value: value)
|
||||
user.save!
|
||||
end
|
||||
|
||||
Given /^the work package "(.+?)" has the custom field "(.+?)" set to "(.+?)"$/ do |wp_name, field_name, value|
|
||||
wp = InstanceFinder.find(WorkPackage, wp_name)
|
||||
custom_field = InstanceFinder.find(WorkPackageCustomField, field_name)
|
||||
|
||||
custom_value = wp.custom_values.detect { |cv| cv.custom_field_id == custom_field.id }
|
||||
|
||||
if custom_value
|
||||
custom_value.value = value
|
||||
else
|
||||
wp.custom_values.build(custom_field: custom_field, value: value)
|
||||
end
|
||||
|
||||
wp.save!
|
||||
end
|
||||
|
||||
Given /^the work package "(.+?)" has the custom user field "(.+?)" set to "(.+?)"$/ do |wp_name, field_name, username|
|
||||
user = User.find_by_login(username)
|
||||
steps %{
|
||||
Given the work package "#{wp_name}" has the custom field "#{field_name}" set to "#{user.id}"
|
||||
}
|
||||
end
|
||||
|
||||
Given(/^the custom field "(.*?)" is enabled for the project "(.*?)"$/) do |field_name, project_name|
|
||||
custom_field = WorkPackageCustomField.find_by(name: field_name)
|
||||
project = Project.find_by(name: project_name)
|
||||
|
||||
project.work_package_custom_fields << custom_field
|
||||
project.save!
|
||||
end
|
||||
|
||||
Given(/^the custom field "(.*?)" is disabled for the project "(.*?)"$/) do |field_name, project_name|
|
||||
custom_field = WorkPackageCustomField.find_by(name: field_name)
|
||||
project = Project.find_by(name: project_name)
|
||||
|
||||
project.work_package_custom_fields.delete custom_field
|
||||
end
|
||||
|
||||
Given /^the custom field "(.*?)" is activated for type "(.*?)"$/ do |field_name, type_name|
|
||||
custom_field = WorkPackageCustomField.find_by(name: field_name)
|
||||
type = ::Type.find_by(name: type_name)
|
||||
custom_field.types << type
|
||||
end
|
||||
|
||||
Given /^there are no custom fields$/ do
|
||||
CustomField.destroy_all
|
||||
end
|
||||
@@ -1,75 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^I should (not )?see "([^"]*)"\s*\#.*$/ do |negative, name|
|
||||
steps %{
|
||||
Then I should #{negative}see "#{name}"
|
||||
}
|
||||
end
|
||||
|
||||
Then /^I should find "([^"]*)"$/ do |element|
|
||||
find(element)
|
||||
end
|
||||
|
||||
When /^I click(?:| on) hidden "([^"]*)"$/ do |name|
|
||||
# I had no luck with find(name, visible: false).click.
|
||||
# Capybara still complained about the element not being visible.
|
||||
# That's why I reverted to using JavaScript directly...
|
||||
page.execute_script("jQuery('#{name}').trigger('click')")
|
||||
end
|
||||
|
||||
When /^I click(?:| on) "([^"]*)"$/ do |name|
|
||||
click_link_or_button(name)
|
||||
end
|
||||
|
||||
When /^I click(?:| on) the div "([^"]*)"$/ do |name|
|
||||
find("##{name}").click
|
||||
end
|
||||
|
||||
Then /^"([^"]*)" should be selected for "([^"]*)"$/ do |value, select_id|
|
||||
expect(find_field(select_id).value).to eql(value)
|
||||
end
|
||||
|
||||
When /^I hover over "([^"]+)"$/ do |selector|
|
||||
page.driver.browser.action.move_to(page.find(selector).native).perform
|
||||
end
|
||||
|
||||
# This moves the mouse to the OP header logo
|
||||
When /^I stop hovering over "([^"]*)"$/ do |_selector|
|
||||
page.driver.browser.action.move_to(page.find('#logo').native).perform
|
||||
end
|
||||
|
||||
When /^I press the "([^"]*)" key on element "([^"]*)"$/ do |key, element|
|
||||
press_key_on_element(key.to_sym, element)
|
||||
end
|
||||
|
||||
When /^I focus the element "([^"]*)"$/ do |element|
|
||||
# moving to an element triggers focus on it as well
|
||||
step %{I hover over "#{element}"}
|
||||
end
|
||||
@@ -1,36 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When(/^I follow the link to see the diff in the last journal$/) do
|
||||
within('.work-packages-full-view--split-right') do
|
||||
# I assume activity sorting oldest to newest; In that case the last journal is
|
||||
# the one where we need to click on the "Details" link
|
||||
all('.work-package-details-activities-activity-contents .description-details').last.click
|
||||
end
|
||||
end
|
||||
@@ -1,52 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the "(.+)" drop-down should( not)? have the following options:$/ do |id, neg, table|
|
||||
meth = neg ? :should_not : :should
|
||||
table.raw.each do |option|
|
||||
page.send(meth, have_xpath("//select[@id = '#{id}']//option[@value = '#{option[0]}']"))
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "(.+)" drop-down should have the following options (enabled|disabled):$/ do |id, state, table|
|
||||
state = state == 'disabled' ? '' : 'not'
|
||||
table.raw.each do |option|
|
||||
page.should have_xpath "//select[@id = '#{id}']//option[@value = '#{option[0]}' and #{state}(@disabled)]"
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "(.+)" drop-down(?: inside "([^\"]*)")? should have "([^\"]*)" selected$/ do |field_name, selector, option_name|
|
||||
with_scope(selector) do
|
||||
find_field(field_name).find('option[selected]').text.should == option_name
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "(.+)" drop-down should have the following sorted options:$/ do |field_name, table|
|
||||
find_field(field_name).all('option').map(&:text).should == table.raw.flatten
|
||||
end
|
||||
@@ -1,42 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
def last_email
|
||||
ActionMailer::Base.deliveries.last
|
||||
end
|
||||
|
||||
def assigned_password_from_last_email
|
||||
last_email.text_part.body.to_s.match(/Password: (.+)$/)[1]
|
||||
end
|
||||
|
||||
Then /^an e-mail should be sent containing "([^\"]*)"$/ do |content|
|
||||
# An e-mail should always have a text representation, so check
|
||||
# whether it contains the expected content
|
||||
last_email.text_part.body.should include(content)
|
||||
end
|
||||
@@ -1,69 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When(/^I create a new enumeration with the following:$/) do |table|
|
||||
attributes = table.rows_hash
|
||||
|
||||
type = activity_type_from_string(attributes['type'])
|
||||
|
||||
visit new_enumeration_path(type: type)
|
||||
|
||||
fill_in 'enumeration_name', with: attributes['name']
|
||||
|
||||
click_button(I18n.t(:button_create))
|
||||
end
|
||||
|
||||
Then(/^I should see the enumeration:$/) do |table|
|
||||
attributes = table.rows_hash
|
||||
|
||||
type = activity_type_from_string(attributes['type'])
|
||||
|
||||
# as the html is not structured in any way we have to look for the first
|
||||
# h3 that contains the heading for the activity we are interested in
|
||||
# and then the td within the directly following table
|
||||
selector = "h3:contains('#{i18n_for_activity_type(type)}') + .generic-table--container table td"
|
||||
should have_selector(selector, text: attributes['name'])
|
||||
end
|
||||
|
||||
def activity_type_from_string(string)
|
||||
case string.gsub(/\s/, '_').camelcase
|
||||
when 'Activity', 'TimeEntryActivity'
|
||||
TimeEntryActivity
|
||||
else
|
||||
raise "Don't know this enumeration yet"
|
||||
end
|
||||
end
|
||||
|
||||
def i18n_for_activity_type(type)
|
||||
if type == TimeEntryActivity
|
||||
I18n.t(:enumeration_activities)
|
||||
else
|
||||
raise "Don't know this enumeration yet"
|
||||
end
|
||||
end
|
||||
@@ -1,63 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^there should( not)? be an(?:y)? error message$/ do |no_message|
|
||||
if no_message
|
||||
should_not have_selector('#errorExplanation')
|
||||
else
|
||||
should have_selector('#errorExplanation')
|
||||
end
|
||||
end
|
||||
|
||||
# This one aims at the rails flash based errors
|
||||
Then /^I should see an error explanation stating "([^"]*)"$/ do |message|
|
||||
page.all(:css, '.errorExplanation li, .errorExplanation li *', text: message).should_not be_empty
|
||||
end
|
||||
|
||||
# This one aims at the angular js notifications which can be errors
|
||||
Then /^I should see an error notification stating "([^"]*)"$/ do |message|
|
||||
step "I should see \"#{message}\" within \".notification-box--errors li\""
|
||||
end
|
||||
|
||||
Then /^there should( not)? be a flash (error|notice) message$/ do |no_message, kind_of_message|
|
||||
if no_message
|
||||
should_not have_selector(".flash.#{kind_of_message}")
|
||||
else
|
||||
should have_selector(".flash.#{kind_of_message}")
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the flash message should contain "([^"]*)"$/ do |message|
|
||||
page.find(:css, '.flash').text.should include(message)
|
||||
end
|
||||
|
||||
Then /^I should( not)? see (\d+) error message(?:s)?$/ do |negative, count|
|
||||
equal = page.all('.errorExplanation').count == count.to_i
|
||||
negative ? (equal.should_not be_truthy) : (equal.should be_truthy)
|
||||
end
|
||||
@@ -1,32 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When /^I submit the form by the "(.+?)" button$/ do |button_text|
|
||||
click_button(button_text, exact: true)
|
||||
end
|
||||
@@ -1,420 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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 'active_record/fixtures'
|
||||
require 'rack_session_access/capybara'
|
||||
|
||||
Before do |scenario|
|
||||
unless ScenarioDisabler.empty_if_disabled(scenario)
|
||||
FactoryBot.create(:admin) unless User.find_by_login('admin')
|
||||
FactoryBot.create(:anonymous) unless AnonymousUser.count > 0
|
||||
Setting.notified_events = [] # can not test mailer
|
||||
end
|
||||
end
|
||||
|
||||
Given /^I am logged in$/ do
|
||||
@user = FactoryBot.create :user
|
||||
page.set_rack_session(user_id: @user.id, updated_at: Time.now)
|
||||
end
|
||||
|
||||
When(/^I log out in the background$/) do
|
||||
page.execute_script("jQuery.ajax('/logout', {
|
||||
success: function () {
|
||||
jQuery(document.body).addClass('logout-ajax')
|
||||
}
|
||||
})")
|
||||
|
||||
page.should have_selector('body.logout-ajax')
|
||||
end
|
||||
|
||||
Given /^(?:|I )am not logged in$/ do
|
||||
User.current = AnonymousUser.first
|
||||
end
|
||||
|
||||
Given /^(?:|I )am [aA]dmin$/ do
|
||||
admin = User.find_by(admin: true)
|
||||
|
||||
login(admin.login, 'adminADMIN!')
|
||||
end
|
||||
|
||||
Given /^(?:|I )am already [aA]dmin$/ do
|
||||
admin = User.find_by(admin: true)
|
||||
# see https://github.com/railsware/rack_session_access
|
||||
page.set_rack_session(user_id: admin.id, updated_at: Time.now)
|
||||
end
|
||||
|
||||
Given /^I am already logged in as "(.+?)"$/ do |login|
|
||||
user = User.find_by_login(login)
|
||||
# see https://github.com/railsware/rack_session_access
|
||||
page.set_rack_session(user_id: user.id, updated_at: Time.now)
|
||||
end
|
||||
|
||||
Given /^(?:|I )am logged in as "([^\"]*)"$/ do |username|
|
||||
login(username, 'adminADMIN!')
|
||||
end
|
||||
|
||||
Given /^there is 1 [pP]roject with(?: the following)?:$/ do |table|
|
||||
p = FactoryBot.build(:project)
|
||||
send_table_to_object(p, table)
|
||||
end
|
||||
|
||||
Then /^the project "([^"]*)" is( not)? public$/ do |project_name, negation|
|
||||
p = Project.find_by(name: project_name)
|
||||
p.update_attribute(:is_public, !negation)
|
||||
end
|
||||
|
||||
Given /^the plugin (.+) is loaded$/ do |plugin_name|
|
||||
plugin_name = plugin_name.gsub("\"", '')
|
||||
|
||||
Redmine::Plugin.all.detect { |x|
|
||||
x.id == plugin_name.to_sym
|
||||
}.present? ? nil : pending("Plugin #{plugin_name} not loaded")
|
||||
end
|
||||
|
||||
Given /^(?:the )?[pP]roject "([^\"]*)" uses the following [mM]odules:$/ do |project, table|
|
||||
p = Project.find_by(name: project)
|
||||
|
||||
p.enabled_module_names += table.raw.map(&:first)
|
||||
p.reload
|
||||
end
|
||||
|
||||
Given /^(?:the )?[pP]roject "([^\"]*)" does not use the following [mM]odules:$/ do |project, table|
|
||||
p = Project.find_by(name: project)
|
||||
|
||||
p.enabled_module_names -= table.raw.map(&:first)
|
||||
p.reload
|
||||
end
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" has 1 time [eE]ntry$/ do |user|
|
||||
u = User.find_by login: user
|
||||
p = u.projects.last
|
||||
raise 'This user must be member of a project to have issues' unless p
|
||||
i = FactoryBot.create(:work_package, project: p)
|
||||
t = FactoryBot.build(:time_entry)
|
||||
t.user = u
|
||||
t.issue = i
|
||||
t.project = p
|
||||
t.activity.project = p
|
||||
t.activity.save!
|
||||
t.save!
|
||||
end
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" has 1 time entry with (\d+\.?\d*) hours? at the project "([^\"]*)"$/ do |user, hours, project|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin do
|
||||
t = FactoryBot.build(:time_entry)
|
||||
i = FactoryBot.create(:work_package, project: p)
|
||||
t.project = p
|
||||
t.issue = i
|
||||
t.hours = hours.to_f
|
||||
t.user = User.find_by login: user
|
||||
t.activity.project = p
|
||||
t.activity.save!
|
||||
t.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [tT]ime(?: )?[eE]ntr(?:ies|y) with the following:$/ do |project, count, table|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin count do
|
||||
t = FactoryBot.build(:time_entry)
|
||||
i = FactoryBot.create(:work_package, project: p)
|
||||
t.project = p
|
||||
t.work_package = i
|
||||
t.activity.project = p
|
||||
t.activity.save!
|
||||
send_table_to_object(t, table,
|
||||
user: Proc.new do |o, v|
|
||||
o.user = User.find_by_login(v)
|
||||
o.save!
|
||||
end,
|
||||
spent_on: Proc.new do |object, value|
|
||||
# This works for definitions like "2 years ago"
|
||||
number, time_unit, tempus = value.split
|
||||
time = number.to_i.send(time_unit.to_sym).send(tempus.to_sym)
|
||||
object.spent_on = time
|
||||
object.save!
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject "([^\"]*)" has 1 [sS]ubproject$/ do |project|
|
||||
parent = Project.find_by(name: project)
|
||||
p = FactoryBot.create(:project)
|
||||
p.set_parent!(parent)
|
||||
p.save!
|
||||
end
|
||||
|
||||
Given /^the [pP]roject "([^\"]*)" has 1 [sS]ubproject with the following:$/ do |project, table|
|
||||
parent = Project.find_by(name: project)
|
||||
p = FactoryBot.build(:project)
|
||||
as_admin do
|
||||
send_table_to_object(p, table)
|
||||
end
|
||||
|
||||
p.set_parent!(parent)
|
||||
p.save!
|
||||
end
|
||||
|
||||
Given /^there are the following types:$/ do |table|
|
||||
table = table.map_headers { |header| header.underscore.gsub(' ', '_') }
|
||||
table.hashes.each_with_index do |t, i|
|
||||
type = ::Type.find_by(name: t['name'])
|
||||
type = ::Type.new name: t['name'] if type.nil?
|
||||
type.position = t['position'] ? t['position'] : i
|
||||
type.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true
|
||||
type.is_milestone = t['is_milestone'] ? t['is_milestone'] : true
|
||||
type.is_default = t['is_default'] ? t['is_default'] : false
|
||||
type.is_standard = t['is_standard'] ? t['is_standard'] : false
|
||||
type.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^there are the following issue status:$/ do |table|
|
||||
table.hashes.each_with_index do |t, i|
|
||||
status = Status.find_by(name: t['name'])
|
||||
status = Status.new name: t['name'] if status.nil?
|
||||
status.is_closed = t['is_closed'] == 'true'
|
||||
status.is_default = t['is_default'] == 'true'
|
||||
status.position = t['position'] ? t['position'] : i
|
||||
status.default_done_ratio = t['default_done_ratio']
|
||||
status.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the type "(.+?)" has the default workflow for the role "(.+?)"$/ do |type_name, role_name|
|
||||
role = Role.find_by(name: role_name)
|
||||
type = ::Type.find_by(name: type_name)
|
||||
type.workflows = []
|
||||
|
||||
Status.order(Arel.sql('id ASC')).map(&:id).combination(2).each do |c|
|
||||
type.workflows.build(old_status_id: c[0], new_status_id: c[1], role: role)
|
||||
end
|
||||
type.save!
|
||||
end
|
||||
|
||||
Given /^the [iI]ssue "([^\"]*)" has (\d+) [tT]ime(?: )?[eE]ntr(?:ies|y) with the following:$/ do |issue, count, table|
|
||||
i = WorkPackage.where(["subject = '#{issue}'"]).last
|
||||
raise "No such issue: #{issue}" unless i
|
||||
as_admin count do
|
||||
t = FactoryBot.build(:time_entry)
|
||||
t.project = i.project
|
||||
t.spent_on = DateTime.now
|
||||
t.work_package = i
|
||||
send_table_to_object(t, table,
|
||||
user: Proc.new do |o, v|
|
||||
o.user = User.find_by_login(v)
|
||||
o.save!
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
Given /^I start debugging$/ do
|
||||
save_and_open_page
|
||||
require 'pry'
|
||||
binding.pry
|
||||
true
|
||||
end
|
||||
|
||||
Given /^I (?:stop|pause) (?:step )?execution$/ do
|
||||
loop do
|
||||
$stdout.puts "\nPausing step execution. Press <Enter> to continue. Enter `debug` to start debugging."
|
||||
text = $stdin.readline
|
||||
|
||||
step 'I start debugging' if text =~ /debug/
|
||||
|
||||
break if text.strip.empty?
|
||||
end
|
||||
end
|
||||
|
||||
When /^(?:|I )login as (.+?)(?: with password (.+))?$/ do |username, password|
|
||||
username = username.gsub("\"", '')
|
||||
password = password.nil? ? 'adminADMIN!' : password.gsub("\"", '')
|
||||
login(username, password)
|
||||
end
|
||||
|
||||
When /^(?:|I )login with autologin enabled as (.+?)(?: with password (.+))?$/ do |username, password|
|
||||
username = username.gsub("\"", '')
|
||||
password = password.nil? ? 'adminADMIN!' : password.gsub("\"", '')
|
||||
page.driver.post signin_path(username: username, password: password, autologin: 1)
|
||||
end
|
||||
|
||||
When 'I logout' do
|
||||
visit '/logout'
|
||||
end
|
||||
|
||||
Then /^I should be logged in as "([^\"]*)"?$/ do |username|
|
||||
user = User.find_by_login(username) || User.anonymous
|
||||
page.should have_xpath("//div[contains(., 'Logged in as #{username}')] |
|
||||
//a[@title='#{user.name}']")
|
||||
|
||||
User.current = user
|
||||
end
|
||||
|
||||
Then 'I should be logged out' do
|
||||
page.should have_css('a.login')
|
||||
end
|
||||
|
||||
When /^I satisfy the "(.+)" plugin to (.+)$/ do |plugin_name, action|
|
||||
if plugin_loaded?(plugin_name)
|
||||
action_name = action.gsub("\"", '')
|
||||
|
||||
plugin_action(plugin_name, action_name)
|
||||
end
|
||||
end
|
||||
|
||||
Given /^I am working in [pP]roject "(.+?)"$/ do |project_name|
|
||||
@project = Project.find_by(name: project_name)
|
||||
end
|
||||
|
||||
Given /^the [pP]roject uses the following modules:$/ do |table|
|
||||
step %{the project "#{get_project}" uses the following modules:}, table
|
||||
end
|
||||
|
||||
Given(/^the user "(.*?)" is responsible$/) do |user|
|
||||
project = get_project
|
||||
project.responsible_id = User.find_by_login(user).id
|
||||
project.save
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following types:$/ do |project_name, table|
|
||||
p = get_project(project_name)
|
||||
table.hashes.each_with_index do |t, i|
|
||||
type = ::Type.find_by(name: t['name'])
|
||||
type = ::Type.new name: t['name'] if type.nil?
|
||||
type.position = t['position'] ? t['position'] : i
|
||||
type.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true
|
||||
type.save!
|
||||
if !p.types.include?(type)
|
||||
p.types << type
|
||||
p.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I wait for "(.*?)" minutes$/) do |number_of_minutes|
|
||||
page.set_rack_session(updated_at: Time.now - number_of_minutes.to_i.minutes)
|
||||
end
|
||||
|
||||
def get_project(project_name = nil)
|
||||
if project_name.blank?
|
||||
project = @project
|
||||
else
|
||||
project = Project.find_by(name: project_name)
|
||||
end
|
||||
if project.nil?
|
||||
if project_name.blank?
|
||||
raise "Could not identify the current project. Make sure to use the 'I am working in project \"Project Name\" step beforehand."
|
||||
else
|
||||
raise "Could not find project with the name \"#{project_name}\"."
|
||||
end
|
||||
end
|
||||
project
|
||||
end
|
||||
|
||||
# Modify a given user using the specified table
|
||||
def modify_user(u, table)
|
||||
as_admin do
|
||||
send_table_to_object(u, table,
|
||||
default_rate: Proc.new do |user, value|
|
||||
user.save!
|
||||
DefaultHourlyRate.new.tap do |r|
|
||||
r.valid_from = 3.years.ago.to_date
|
||||
r.rate = value
|
||||
r.user_id = user.id
|
||||
end.save!
|
||||
end,
|
||||
name: Proc.new { |user, _value| user.login = name; user.save! },
|
||||
hourly_rate: Proc.new do |user, value|
|
||||
user.save!
|
||||
HourlyRate.new.tap do |r|
|
||||
r.valid_from = (2.years.ago + HourlyRate.count.days).to_date
|
||||
r.rate = value
|
||||
r.user_id = user.id
|
||||
r.project = user.projects.last
|
||||
end.save!
|
||||
end
|
||||
)
|
||||
|
||||
u.save!
|
||||
end
|
||||
u
|
||||
end
|
||||
|
||||
# Encapsulate the logic to set a custom field on an issue
|
||||
def add_custom_value_to_issue(object, key, value)
|
||||
if WorkPackageCustomField.all.map(&:name).include? key.to_s
|
||||
cv = CustomValue.where(["customized_id = '#{object.id}'"]).first
|
||||
cv ||= CustomValue.new
|
||||
cv.customized_type = 'WorkPackage'
|
||||
cv.customized_id = object.id
|
||||
cv.custom_field_id = WorkPackageCustomField.find_by(name: key).id
|
||||
cv.value = value
|
||||
cv.save!
|
||||
end
|
||||
end
|
||||
|
||||
# Try to assign an object the values set in a table
|
||||
def send_table_to_object(object, table, except = {}, rescue_block = nil)
|
||||
return unless table.raw.present?
|
||||
as_admin do
|
||||
table.rows_hash.each do |key, value|
|
||||
_key = key.gsub(' ', '_').underscore.to_sym
|
||||
if except[_key]
|
||||
except[_key].call(object, value)
|
||||
elsif except[key]
|
||||
except[key].call(object, value)
|
||||
elsif object.respond_to? :"#{_key}="
|
||||
object.send(:"#{_key}=", value)
|
||||
elsif rescue_block
|
||||
rescue_block.call(object, key, value)
|
||||
else
|
||||
raise "No such method #{_key} on a #{object.class}"
|
||||
end
|
||||
end
|
||||
object.save!
|
||||
end
|
||||
end
|
||||
|
||||
# Do something as admin
|
||||
def as_admin(count = 1)
|
||||
cur_user = User.current
|
||||
User.current = User.find_by_login('admin')
|
||||
retval = nil
|
||||
count.to_i.times do
|
||||
retval = yield
|
||||
end
|
||||
User.current = cur_user
|
||||
retval
|
||||
end
|
||||
|
||||
def plugin_loaded?(name)
|
||||
Redmine::Plugin.all.detect { |x| x.id == name.to_sym }.present?
|
||||
end
|
||||
@@ -1,82 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^there is 1 group with the following:$/ do |table|
|
||||
group = FactoryBot.build(:group)
|
||||
|
||||
send_table_to_object group, table, name: Proc.new { |group, name| group.lastname = name }
|
||||
end
|
||||
|
||||
Given /^the group "(.+)" is a "(.+)" in the project "(.+)"$/ do |group_name, role_name, project_identifier|
|
||||
steps %{ Given the principal "#{group_name}" is a "#{role_name}" in the project "#{project_identifier}" }
|
||||
end
|
||||
|
||||
Given /^the group "(.+?)" has the following members:$/ do |name, table|
|
||||
group = Group.find_by(lastname: name)
|
||||
|
||||
raise "No group with name #{name} found" unless group.present?
|
||||
|
||||
user_names = table.raw.flatten
|
||||
|
||||
users = User.where(login: user_names)
|
||||
|
||||
not_found = user_names - users.map(&:login)
|
||||
|
||||
raise "Could not find users with login: #{not_found}" if not_found.size > 0
|
||||
|
||||
group.add_members!(users)
|
||||
end
|
||||
|
||||
When /^I add the user "(.+)" to the group$/ do |user_login|
|
||||
user = User.find_by!(login: user_login)
|
||||
|
||||
steps %{
|
||||
When I check "#{user.name}" within "#tab-content-users #users"
|
||||
And I press "Add" within "#tab-content-users"
|
||||
}
|
||||
end
|
||||
|
||||
Given /^We have the group "(.*?)"/ do |name|
|
||||
group = FactoryBot.create(:group, lastname: name)
|
||||
end
|
||||
|
||||
Given /^there is a group named "(.*?)" with the following members:$/ do |name, table|
|
||||
group = FactoryBot.create(:group, lastname: name)
|
||||
|
||||
table.raw.flatten.each do |login|
|
||||
group.add_members!(User.find_by!(login: login))
|
||||
end
|
||||
end
|
||||
|
||||
When /^I delete "([^"]*)" from the group$/ do |login|
|
||||
user = User.find_by!(login: login)
|
||||
step %(I follow "Delete" within "#user-#{user.id}")
|
||||
end
|
||||
|
||||
InstanceFinder.register(Group, Proc.new { |name| Group.find_by(lastname: name) })
|
||||
@@ -1,149 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the following languages are active:$/ do |table|
|
||||
Setting.available_languages = table.raw.flatten
|
||||
end
|
||||
|
||||
Given /^the (.+) called "(.+)" has the following localizations:$/ do |model_name, object_name, table|
|
||||
model = model_name.downcase.gsub(/\s/, '_').camelize.constantize
|
||||
object = model.find_by(name: object_name)
|
||||
|
||||
object.translations = []
|
||||
|
||||
table.hashes.each do |h|
|
||||
h.each do |k, v|
|
||||
h[k] = nil if v == 'nil'
|
||||
end
|
||||
|
||||
object.translations.create h
|
||||
end
|
||||
end
|
||||
|
||||
When /^I delete the (.+) localization of the "(.+)" attribute$/ do |language, attribute|
|
||||
locale = locale_for_language language
|
||||
|
||||
page.should have_selector("span.#{attribute}_translation :first-child")
|
||||
spans = page.all(:css, "span.#{attribute}_translation")
|
||||
# Use the [] method since Firefox doesn't change the 'selected' attribute
|
||||
# when choosing the last available option of a select where all other
|
||||
# options are disabled. Check scenario 'Deleting a newly added localization'
|
||||
# when changing this.
|
||||
span = spans.detect { |span|
|
||||
span.find(:css, '.locale_selector')['value'] == locale
|
||||
}
|
||||
|
||||
destroy = span.find(:css, 'a.destroy_locale')
|
||||
|
||||
destroy.click
|
||||
end
|
||||
|
||||
When /^I change the (.+) localization of the "(.+)" attribute to be (.+)$/ do |language, attribute, new_language|
|
||||
attribute_span = span_for_localization language, attribute
|
||||
|
||||
locale_selector = attribute_span.find(:css, '.locale_selector')
|
||||
|
||||
locale_name = locale_selector.all(:css, 'option').detect { |o| o.value == locale_for_language(new_language) }
|
||||
locale_selector.select(locale_name.text) if locale_name
|
||||
end
|
||||
|
||||
When /^I add the (.+) localization of the "(.+)" attribute as "(.+)"$/ do |language, attribute, value|
|
||||
# Emulate old find behavior, just use first match. Better would be
|
||||
# selecting an element by id.
|
||||
attribute_p = page.find(:xpath, "(//span[contains(@class, '#{attribute}_translation')])[1]/..")
|
||||
add_link = attribute_p.find(:css, '.add_locale')
|
||||
add_link.click
|
||||
span = attribute_p.all(:css, ".#{attribute}_translation").last
|
||||
|
||||
update_localization(span, language, value)
|
||||
end
|
||||
|
||||
# Maybe this step can replace 'I change the ... localization of the ... attribute'
|
||||
When /^I set the (.+) localization of the "(.+)" attribute to "(.+)"$/ do |language, attribute, value|
|
||||
locale = locale_for_language language
|
||||
|
||||
# Look for a span with #{attribute}_translation class, which doesn't have an
|
||||
# ancestor with style display: none
|
||||
span = page.find(:xpath, "//span[contains(@class, '#{attribute}_translation') " +
|
||||
"and not(ancestor-or-self::*[starts-with(normalize-space(substring-after(@style, 'display:')), 'none')])]")
|
||||
update_localization(span, language, value)
|
||||
end
|
||||
|
||||
def update_localization(container, language, value)
|
||||
new_value = container.find(:css, 'input[type=text], textarea')
|
||||
new_locale = container.find(:css, '.locale_selector', visible: false)
|
||||
|
||||
new_value.set(value.gsub('\\n', "\n"))
|
||||
|
||||
locale_name = new_locale.all(:css, 'option', visible: false).detect { |o| o.value == locale_for_language(language) }
|
||||
new_locale.select(locale_name.text) if locale_name
|
||||
end
|
||||
|
||||
Then /^the delete link for the (.+) localization of the "(.+)" attribute should not be visible$/ do |locale, attribute_name|
|
||||
attribute_span = span_for_localization locale, attribute_name
|
||||
|
||||
attribute_span.find(:css, 'a.destroy_locale', visible: false).should_not be_visible
|
||||
end
|
||||
|
||||
def span_for_localization(language, attribute)
|
||||
locale = locale_for_language language
|
||||
|
||||
attribute_spans = page.all(:css, "span.#{attribute}_translation")
|
||||
|
||||
attribute_spans.detect do |attribute_span|
|
||||
attribute_span.find(:css, '.locale_selector', visible: false)['value'] == locale &&
|
||||
attribute_span.visible?
|
||||
end
|
||||
end
|
||||
|
||||
def locale_for_language(language)
|
||||
{ 'german' => 'de', 'english' => 'en', 'french' => 'fr' }[language]
|
||||
end
|
||||
|
||||
Then(/^I should see "(.*?)" for report "(.*?)"$/) do |link_name, table_value_name|
|
||||
within 'table.generic-table' do
|
||||
table_data = first('td a', text: table_value_name)
|
||||
row = table_data.find(:xpath, '../..')
|
||||
|
||||
expect(row).to have_selector('a', text: link_name)
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I follow link "(.*?)" for report "(.*?)"$/) do |link_name, table_value_name|
|
||||
within 'table.generic-table' do
|
||||
table_data = first('td a', text: table_value_name)
|
||||
row = table_data.find(:xpath, '../..')
|
||||
|
||||
row.find('a', text: link_name).click
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^I should see button "(.*?)"$/) do |button_name|
|
||||
expect(page).to have_selector('span.hidden-for-sighted', text: button_name, visible: false)
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^I should see the "(.+)" image(?: within "([^\"]*)")?$/ do |image, selector|
|
||||
search_string = selector ? Nokogiri::CSS.xpath_for(selector).first + "//img[contains(@src,\"#{image}\")]" : "//img[contains(@src,\"#{image}\")]"
|
||||
page.should have_xpath(search_string)
|
||||
end
|
||||
|
||||
Then /^I should not see the "(.+)" image(?: within "([^\"]*)")?$/ do |image, selector|
|
||||
search_string = selector ? Nokogiri::CSS.xpath_for(selector).first + "//img[contains(@src,\"#{image}\")]" : "//img[contains(@src,\"#{image}\")]"
|
||||
page.should have_no_xpath(search_string)
|
||||
end
|
||||
|
||||
Then /^I should see an image$/ do
|
||||
img = find :css, 'img'
|
||||
img.should be_present
|
||||
img.should be_visible
|
||||
end
|
||||
@@ -1,48 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
InstanceFinder.register(Category, Proc.new { |name| Category.find_by(name: name) })
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [cC]ategor(?:ies|y)? with(?: the following)?:$/ do |project, count, table|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
table.rows_hash['assigned_to'] = Principal.like(table.rows_hash['assigned_to']).first if table.rows_hash['assigned_to']
|
||||
as_admin count do
|
||||
ic = FactoryBot.build(:category, project: p)
|
||||
send_table_to_object(ic, table)
|
||||
ic.save
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [cC]ategor(?:ies|y)?$/ do |project, count|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin count do
|
||||
ic = FactoryBot.build(:category, project: p)
|
||||
ic.save
|
||||
end
|
||||
end
|
||||
@@ -1,104 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# TODO: check if this step can be removed as it is plugin specific
|
||||
Given /^there is a standard project named "([^\"]*)"$/ do |name|
|
||||
steps %{
|
||||
Given there is 1 project with the following:
|
||||
| Name | #{name} |
|
||||
And there is a role "Manager"
|
||||
And there is a role "Developer"
|
||||
And there is a role "Designer"
|
||||
And the role "Manager" may have the following rights:
|
||||
| view_own_hourly_rate |
|
||||
| view_hourly_rates |
|
||||
| view_cost_rates |
|
||||
| view_own_time_entries |
|
||||
| view_own_cost_entries |
|
||||
| view_cost_entries |
|
||||
| view_time_entries |
|
||||
And the role "Developer" may have the following rights:
|
||||
| view_own_hourly_rate |
|
||||
| view_hourly_rates |
|
||||
| view_cost_rates |
|
||||
| view_own_time_entries |
|
||||
| view_own_cost_entries |
|
||||
| view_cost_entries |
|
||||
| view_time_entries |
|
||||
And the role "Designer" may have the following rights:
|
||||
| view_own_hourly_rate |
|
||||
| view_hourly_rates |
|
||||
| view_cost_rates |
|
||||
| view_own_time_entries |
|
||||
| view_own_cost_entries |
|
||||
| view_cost_entries |
|
||||
| view_time_entries |
|
||||
And there is 1 user with:
|
||||
| Login | manager |
|
||||
| Firstname | Mac |
|
||||
| Lastname | Moneysack |
|
||||
| default rate | 10.00 |
|
||||
And there is 1 user with:
|
||||
| Login | developer |
|
||||
| Firstname | Alan |
|
||||
| Lastname | Kay |
|
||||
| default rate | 10.00 |
|
||||
And there is 1 user with:
|
||||
| Login | designer |
|
||||
| Firstname | Tom |
|
||||
| Lastname | Kelley |
|
||||
| default rate | 10.00 |
|
||||
And the user "manager" is a "Manager" in the project "#{name}"
|
||||
And the user "designer" is a "Designer" in the project "#{name}"
|
||||
And the user "developer" is a "Developer" in the project "#{name}"
|
||||
}
|
||||
end
|
||||
|
||||
Then /^[iI] should (not )?see "([^\"]*)" in the overall sum(?:s)?$/ do |negative, sum|
|
||||
step %{I should #{negative}see "#{sum}" within "tr.sum.all"}
|
||||
end
|
||||
|
||||
Then /^[iI] should see "([^\"]*)" in the grouped sum(?:s)?$/ do |sum|
|
||||
find(:xpath, "//tr[contains(concat(' ',normalize-space(@class),' '),' grouped ')]/td[contains(text(), '#{sum}')]").should_not(be_nil, "Could not find the grouped sum '#{sum}'")
|
||||
end
|
||||
|
||||
Then /^[iI] should not see "([^\"]*)" in the grouped sum(?:s)?$/ do |sum|
|
||||
begin
|
||||
find(:xpath, "//tr[contains(concat(' ',normalize-space(@class),' '),' grouped ')]/td[contains(text(), '#{sum}')]").should(be_nil, "Could find the grouped sum '#{sum}'")
|
||||
rescue Capybara::ElementNotFound => e
|
||||
# it's fine when the element is not there at all
|
||||
end
|
||||
end
|
||||
|
||||
Then /^[iI] toggle the [oO]ptions fieldset$/ do
|
||||
page.execute_script <<-JS
|
||||
f = $$("fieldset").without($("filters")).first();
|
||||
toggleFieldset($(f).select("legend").first());
|
||||
JS
|
||||
end
|
||||
@@ -1,131 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^there are no issues$/ do
|
||||
WorkPackage.destroy_all
|
||||
end
|
||||
|
||||
Given /^the issue "(.*?)" is watched by:$/ do |issue_subject, watchers|
|
||||
issue = WorkPackage.where(subject: issue_subject).order(:created_at).last
|
||||
watchers.raw.flatten.each do |w| issue.add_watcher User.find_by_login(w) end
|
||||
issue.save
|
||||
end
|
||||
|
||||
Then /^the issue "(.*?)" should have (\d+) watchers$/ do |issue_subject, watcher_count|
|
||||
WorkPackage.find_by(subject: issue_subject).watchers.count.should == watcher_count.to_i
|
||||
end
|
||||
|
||||
Given(/^the issue "(.*?)" has an attachment "(.*?)"$/) do |issue_subject, file_name|
|
||||
content_type = 'image/gif'
|
||||
issue = WorkPackage.where(subject: issue_subject).order(:created_at).last
|
||||
file = OpenProject::Files.create_temp_file name: file_name,
|
||||
content: 'random content which is not actually a gif'
|
||||
attachment = FactoryBot.create :attachment,
|
||||
author: issue.author,
|
||||
content_type: content_type,
|
||||
file: file,
|
||||
container: issue,
|
||||
description: 'This is an attachment description'
|
||||
|
||||
attachment
|
||||
end
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" has (\d+) [iI]ssue(?:s)? with(?: the following)?:$/ do |user, count, table|
|
||||
u = User.find_by login: user
|
||||
raise 'This user must be member of a project to have issues' unless u.projects.last
|
||||
as_admin count do
|
||||
i = FactoryBot.create(:work_package,
|
||||
project: u.projects.last,
|
||||
author: u,
|
||||
assigned_to: u,
|
||||
status: Status.default || FactoryBot.create(:status))
|
||||
|
||||
i.type = ::Type.find_by(name: table.rows_hash.delete('type')) if table.rows_hash['type']
|
||||
|
||||
send_table_to_object(i, table, {}, method(:add_custom_value_to_issue))
|
||||
i.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [iI]ssue(?:s)? with(?: the following)?:$/ do |project, count, table|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin count do
|
||||
i = FactoryBot.build(:work_package, project: p,
|
||||
type: p.types.first)
|
||||
send_table_to_object(i, table, {}, method(:add_custom_value_to_issue))
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I click the first delete attachment link$/) do
|
||||
within('.work-package--attachments--files') do
|
||||
find('.icon-delete', visible: false).click
|
||||
end
|
||||
end
|
||||
|
||||
Given (/^there are the following issues(?: in project "([^"]*)")?:$/) do |project_name, table|
|
||||
table.hashes.map do |h| h['project'] = project_name end
|
||||
modified_table = Cucumber::Core::Ast::DataTable.new(table.hashes, table.location)
|
||||
argument_table = Cucumber::MultilineArgument::DataTable.new modified_table
|
||||
step %{there are the following issues with attributes:}, argument_table
|
||||
end
|
||||
|
||||
Given (/^there are the following issues with attributes:$/) do |table|
|
||||
table = table.map_headers { |header| header.underscore.gsub(' ', '_') }
|
||||
table.hashes.each do |type_attributes|
|
||||
project = get_project(type_attributes.delete('project'))
|
||||
attributes = type_attributes.merge(project_id: project.id) if project
|
||||
|
||||
assignee = User.find_by_login(attributes.delete('assignee'))
|
||||
attributes.merge! assigned_to_id: assignee.id if assignee
|
||||
|
||||
author = User.find_by_login(attributes.delete('author'))
|
||||
attributes.merge! author_id: author.id if author
|
||||
|
||||
responsible = User.find_by_login(attributes.delete('responsible'))
|
||||
attributes.merge! responsible_id: responsible.id if responsible
|
||||
|
||||
watchers = attributes.delete('watched_by')
|
||||
|
||||
type = ::Type.find_by(name: attributes.delete('type'))
|
||||
attributes.merge! type_id: type.id if type
|
||||
|
||||
version = Version.find_by(name: attributes.delete('version'))
|
||||
attributes.merge! version_id: version.id if version
|
||||
|
||||
category = Category.find_by(name: attributes.delete('category'))
|
||||
attributes.merge! category_id: category.id if category
|
||||
|
||||
issue = FactoryBot.create(:work_package, attributes)
|
||||
|
||||
if watchers
|
||||
watchers.split(',').each do |w| issue.add_watcher User.find_by_login(w) end
|
||||
issue.save
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,34 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /I should see a journal with the following:$/ do |table|
|
||||
if table.rows_hash['Notes']
|
||||
should have_css('.work-package-details-activities-list', text: table.rows_hash['Notes'])
|
||||
end
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^the "([^"]*)" link should point to "([^"]*)"$/ do |title, target|
|
||||
node = page.find(:xpath, "//a[contains(.,'#{title}')]")
|
||||
node['href'].should == target
|
||||
end
|
||||
@@ -1,98 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When /^I toggle the "([^"]+)" submenu$/ do |menu_name|
|
||||
nodes = all(:css, ".menu_root a[title=\"#{menu_name}\"] + .toggler")
|
||||
|
||||
# w/o javascript, all menu elements are expanded by default. So the toggler
|
||||
# might not be present.
|
||||
nodes.first.click if nodes.present?
|
||||
end
|
||||
|
||||
Then /^there should be no child menu item selected$/ do
|
||||
page.should_not have_css('.main-menu--children .selected')
|
||||
end
|
||||
|
||||
Then /^there should not be a main menu$/ do
|
||||
page.should_not have_css('#main-menu')
|
||||
end
|
||||
|
||||
Then /^I should (not )?see "(.*?)" as being logged in$/ do |negative, name|
|
||||
if negative
|
||||
page.should_not have_link(name)
|
||||
else
|
||||
page.should have_link(name)
|
||||
end
|
||||
end
|
||||
|
||||
# opens a menu item in the main menu
|
||||
When /^I open the "([^"]+)" (?:sub)?menu$/ do |menu_name|
|
||||
nodes = all(:css, ".menu_root a[title=\"#{menu_name}\"]")
|
||||
|
||||
# w/o javascript, all menu elements are expanded by default. So the toggler
|
||||
# might not be present.
|
||||
nodes.first.click if nodes.present?
|
||||
end
|
||||
|
||||
When /^I select "(.+?)" from the action menu$/ do |entry_name|
|
||||
within(action_menu_selector) do
|
||||
find('button').click
|
||||
end
|
||||
within('.dropdown-menu') do
|
||||
click_link(entry_name)
|
||||
end
|
||||
end
|
||||
|
||||
When /^I click on the edit button$/ do
|
||||
within('#toolbar-items') do
|
||||
find('.edit-all-button').click
|
||||
end
|
||||
end
|
||||
|
||||
Then /^there should not be a "(.+?)" entry in the action menu$/ do |entry_name|
|
||||
within(action_menu_selector) do
|
||||
should_not have_link(entry_name)
|
||||
end
|
||||
end
|
||||
|
||||
def action_menu_selector
|
||||
# supports both the old and the new selector for the action menu
|
||||
# please note that using this with the old .contextual selector takes longer
|
||||
# as capybara waits for the new .action_menu_main selector to appear
|
||||
|
||||
if has_css?('.action_menu_main')
|
||||
all('.action_menu_main').first
|
||||
elsif has_css?('.action_menu_specific')
|
||||
all('.action_menu_specific').first
|
||||
elsif has_css?('.contextual')
|
||||
all('.contextual').first
|
||||
else
|
||||
raise 'No action menu on the current page'
|
||||
end
|
||||
end
|
||||
@@ -1,60 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^the "(.+)" widget should be in the top block$/ do |widget_name|
|
||||
steps %{Then I should see "#{widget_name}" within "#top"}
|
||||
end
|
||||
|
||||
When /^I select "(.+)" from the available widgets drop down$/ do |widget_name|
|
||||
steps %{When I select "#{widget_name}" from "block-options"}
|
||||
end
|
||||
|
||||
Then /^I should see the dropdown of available widgets$/ do
|
||||
page.has_select?('block-options', options: ['Watched Issues', 'Issues assigned to me'])
|
||||
end
|
||||
|
||||
Then(/^I should see the widget "([^"]*)"$/) do |arg|
|
||||
page.find("#block_#{arg}").should_not be_nil
|
||||
end
|
||||
|
||||
Then /^"(.+)" should( not)? be disabled in the my page available widgets drop down$/ do |widget_name, neg|
|
||||
option_name = MyController.available_blocks.detect { |_k, v| I18n.t(v) == widget_name }.first.dasherize
|
||||
|
||||
unless neg
|
||||
steps %{Then the "block-options" drop-down should have the following options disabled:
|
||||
| #{option_name} |}
|
||||
else
|
||||
steps %{Then the "block-options" drop-down should have the following options enabled:
|
||||
| #{option_name} |}
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I click the first delete block link$/) do
|
||||
all(:xpath, "//a[@title='Remove widget']")[0].click
|
||||
end
|
||||
@@ -1,152 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
def parse_password_rules(str)
|
||||
str.sub(', and ', ', ').split(', ')
|
||||
end
|
||||
|
||||
Given /^passwords must contain ([0-9]+) of ([a-z, ]+) characters$/ do |minimum_rules, rules|
|
||||
rules = parse_password_rules(rules)
|
||||
Setting.password_active_rules = rules
|
||||
Setting.password_min_adhered_rules = minimum_rules.to_i
|
||||
end
|
||||
|
||||
Given /^passwords have a minimum length of ([0-9]+) characters$/ do |minimum_length|
|
||||
Setting.password_min_length = minimum_length
|
||||
end
|
||||
|
||||
Given /^users are not allowed to reuse the last ([0-9]+) passwords$/ do |count|
|
||||
Setting.password_count_former_banned = count
|
||||
end
|
||||
|
||||
def fill_change_password(old_password, new_password, confirmation = new_password)
|
||||
# use find and set with id to prevent ambiguous match I get with fill_in
|
||||
find('#password').set(old_password)
|
||||
|
||||
fill_in('new_password', with: new_password)
|
||||
fill_in('new_password_confirmation', with: confirmation)
|
||||
click_link_or_button 'Save'
|
||||
@new_password = new_password
|
||||
end
|
||||
|
||||
def change_password(old_password, new_password)
|
||||
visit '/my/password'
|
||||
fill_change_password(old_password, new_password)
|
||||
end
|
||||
|
||||
Given /^I try to change my password from "([^\"]+)" to "([^\"]+)"$/ do |old, new|
|
||||
change_password(old, new)
|
||||
end
|
||||
|
||||
When /^I try to set my new password to "(.+)"$/ do |password|
|
||||
visit '/my/password'
|
||||
change_password('adminADMIN!', password)
|
||||
end
|
||||
|
||||
When /^I fill out the change password form$/ do
|
||||
fill_change_password('adminADMIN!', 'adminADMIN!New')
|
||||
end
|
||||
|
||||
When /^I fill out the change password form with a wrong old password$/ do
|
||||
fill_change_password('wrong', 'adminADMIN!New')
|
||||
end
|
||||
|
||||
When /^I fill out the change password form with a wrong password confirmation$/ do
|
||||
fill_change_password('adminADMIN!', 'adminADMIN!New', 'wrong')
|
||||
end
|
||||
|
||||
Then /^the password change should succeed$/ do
|
||||
find('.notice').should have_content('success')
|
||||
end
|
||||
|
||||
Then /^I should be able to login using the new password$/ do
|
||||
visit('/logout')
|
||||
login(@user.login, @new_password)
|
||||
end
|
||||
|
||||
Then /^the password and confirmation fields should be empty$/ do
|
||||
find('#user_password').value.should be_empty
|
||||
find('#user_password_confirmation').value.should be_empty
|
||||
end
|
||||
|
||||
Then /^the password and confirmation fields should be disabled$/ do
|
||||
find('#user_password').should be_disabled
|
||||
find('#user_password_confirmation').should be_disabled
|
||||
end
|
||||
|
||||
Then /^the force password change field should be checked$/ do
|
||||
find('#user_force_password_change').should be_checked
|
||||
end
|
||||
|
||||
Then /^the force password change field should be disabled$/ do
|
||||
find('#user_force_password_change').should be_disabled
|
||||
end
|
||||
|
||||
Given /^I try to log in with user "([^"]*)"$/ do |login|
|
||||
step 'I go to the logout page'
|
||||
login(login, @new_password || 'adminADMIN!')
|
||||
end
|
||||
|
||||
Given /^I try to log in with user "([^"]*)" and a wrong password$/ do |login|
|
||||
step 'I go to the logout page'
|
||||
login(login, 'Wrong password')
|
||||
end
|
||||
|
||||
Given /^I try to log in with user "([^"]*)" and the password sent via email$/ do |login|
|
||||
step 'I go to the logout page'
|
||||
login(login, assigned_password_from_last_email)
|
||||
end
|
||||
|
||||
When /^I activate the ([a-z, ]+) password rules$/ do |rules|
|
||||
rules = parse_password_rules(rules)
|
||||
# ensure checkboxes are loaded, 'all' doesn't wait
|
||||
should have_selector(:xpath, "//input[@id='settings_password_active_rules_' and @value='#{rules.first}']")
|
||||
|
||||
all(:xpath, "//input[@id='settings_password_active_rules_']").each do |checkbox|
|
||||
checkbox.set(false)
|
||||
end
|
||||
rules.each do |rule|
|
||||
find(:xpath, "//input[@id='settings_password_active_rules_' and @value='#{rule}']").set(true)
|
||||
end
|
||||
end
|
||||
|
||||
def set_user_attribute(login, attribute, value)
|
||||
user = User.find_by login: login
|
||||
user.send((attribute.to_s + '=').to_sym, value)
|
||||
user.save
|
||||
end
|
||||
|
||||
Given /^the user "(.+)" is(not |) forced to change his password$/ do |login, disable|
|
||||
set_user_attribute(login, :force_password_change, disable != 'not ')
|
||||
end
|
||||
|
||||
Given /^I use the first existing token to request a password reset$/ do
|
||||
token = Token::Recovery.first
|
||||
visit account_lost_password_path(token: token.value)
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the principal "(.+)" is a "(.+)" in the project "(.+)"$/ do |principal_name, role_name, project_identifier|
|
||||
project = Project.find_by(identifier: project_identifier)
|
||||
raise "No project with identifier '#{project_identifier}' found" if project.nil?
|
||||
|
||||
role = Role.find_by(name: role_name)
|
||||
raise "No role with name '#{role_name}' found" if role.nil?
|
||||
|
||||
principal = InstanceFinder.find(Principal, principal_name)
|
||||
|
||||
project.add_member!(principal, role)
|
||||
end
|
||||
|
||||
InstanceFinder.register(Principal, Proc.new { |name|
|
||||
princ = Principal.where(['lastname = ? OR login = ?', name, name]).first
|
||||
princ || Principal.find { |principal| principal.name == name }
|
||||
})
|
||||
@@ -1,46 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
InstanceFinder.register(IssuePriority, Proc.new { |name| IssuePriority.find_by(name: name) })
|
||||
|
||||
Given /^there is a(?:n)? (default )?issuepriority$/ do |default|
|
||||
FactoryBot.create(:priority, is_default: !!default, project: get_project)
|
||||
end
|
||||
|
||||
Given /^there are the following priorities:$/ do |table|
|
||||
table.hashes.each do |row|
|
||||
project = get_project
|
||||
|
||||
FactoryBot.build(:priority).tap do |prio|
|
||||
prio.name = row[:name]
|
||||
prio.is_default = row[:default] == 'true'
|
||||
prio.project = project
|
||||
end.save!
|
||||
end
|
||||
end
|
||||
@@ -1,108 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When /^I check the role "(.+?)" for the project member "(.+?)"$/ do |role_name, user_login|
|
||||
role = Role.find_by(name: role_name)
|
||||
|
||||
member = member_for_login user_login
|
||||
|
||||
steps %{When I check "member_role_ids_#{role.id}" within "#member-#{member.id}"}
|
||||
end
|
||||
|
||||
Then /^the project member "(.+?)" should not be in edit mode$/ do |user_login|
|
||||
member = member_for_login user_login
|
||||
|
||||
page.find("#member-#{member.id}-roles-form", visible: false).should_not be_visible
|
||||
end
|
||||
|
||||
Then /^the project member "(.+?)" should have the role "(.+?)"$/ do |user_login, role_name|
|
||||
member = member_for_login user_login
|
||||
|
||||
steps %{Then I should see "#{role_name}" within "#member-#{member.id}-roles"}
|
||||
end
|
||||
|
||||
When /^I follow the delete link of the project member "(.+?)"$/ do |login_name|
|
||||
member = member_for_login login_name
|
||||
|
||||
steps %{When I follow "Delete" within "#member-#{member.id}"}
|
||||
end
|
||||
|
||||
When /^I add(?: the)? principal "(.+)" as(?: a)? "(.+)"$/ do |principal, role|
|
||||
steps %{
|
||||
And I select the principal "#{principal}"
|
||||
And I select the role "#{role}"
|
||||
And I click on "Add"
|
||||
And I wait for AJAX
|
||||
}
|
||||
end
|
||||
|
||||
When /^I select(?: the)? role "(.+)"$/ do |role|
|
||||
found_role = Role.like(role).first
|
||||
raise "No Role #{role} found" unless found_role
|
||||
select_role(found_role)
|
||||
end
|
||||
|
||||
def select_role(role)
|
||||
select(role.name, from: 'member_role_ids')
|
||||
end
|
||||
|
||||
When /^I add the principal "(.+)" as a member with the roles:$/ do |principal_name, roles_table|
|
||||
roles_table.raw.flatten.each do |role_name|
|
||||
steps %{ When I add the principal "#{principal_name}" as a "#{role_name}" }
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should see the principal "(.+)" as a member with the roles:$/ do |principal_name, roles_table|
|
||||
principal = InstanceFinder.find(Principal, principal_name)
|
||||
steps %{ Then I should see "#{principal.name}" within ".generic-table" }
|
||||
|
||||
found_roles = page.find(:xpath, "//tr[contains(concat(' ',normalize-space(@class),' '),' member ')][contains(.,'#{principal.name}')]").find(:css, 'td.roles span').text.split(',').map(&:strip)
|
||||
|
||||
found_roles.should =~ roles_table.raw.flatten
|
||||
end
|
||||
|
||||
Then /^I should not see the principal "(.+)" as a member$/ do |principal_name|
|
||||
principal = InstanceFinder.find(Principal, principal_name)
|
||||
|
||||
steps %{ Then I should not see "#{principal.name}" within ".generic-table" }
|
||||
end
|
||||
|
||||
When /^I delete the "([^"]*)" membership$/ do |group_name|
|
||||
membership = member_for_login(group_name)
|
||||
step %(I follow "Delete" within "#member-#{membership.id}")
|
||||
end
|
||||
|
||||
def member_for_login(principal_name)
|
||||
principal = InstanceFinder.find(Principal, principal_name)
|
||||
|
||||
sleep 1
|
||||
|
||||
# the assumption here is, that there is only one project
|
||||
principal.members.first
|
||||
end
|
||||
@@ -1,35 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^there is a project named "([^"]*)"?$/ do |name|
|
||||
attributes = { name: name,
|
||||
identifier: name.downcase.gsub(' ', '_') }
|
||||
|
||||
FactoryBot.create(:project, attributes)
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [wW]ork [pP]ackage [qQ]uer(?:ies|y)? with(?: the following)?:$/ do |project, count, table|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin count do
|
||||
i = FactoryBot.build(:query, project: p)
|
||||
send_table_to_object(i, table)
|
||||
i.save
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has (\d+) [wW]ork [pP]ackage [qQ]uer(?:ies|y)?$/ do |project, count|
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
as_admin count do
|
||||
i = FactoryBot.build(:query, project: p)
|
||||
i.save
|
||||
end
|
||||
end
|
||||
@@ -1,37 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given (/^I open the registration modal$/) do
|
||||
steps %{
|
||||
Given I am on the homepage
|
||||
And I open the "Sign in" menu
|
||||
And I click link "#registration-modal--activation-link"
|
||||
Then I should see "t:onboarding.welcome" within ".op-modal--modal-header" [i18n]
|
||||
}
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given(/^the project "(.*?)" has a repository$/) do |project_name|
|
||||
project = Project.find(project_name)
|
||||
|
||||
repo = FactoryBot.build(:repository_subversion,
|
||||
project: project)
|
||||
|
||||
Setting.enabled_scm = Setting.enabled_scm << repo.vendor
|
||||
|
||||
repo.save!
|
||||
end
|
||||
@@ -1,92 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" is a "([^\"]*)" (?:in|of) the [Pp]roject "([^\"]*)"$/ do |user, role, project|
|
||||
u = User.find_by_login(user)
|
||||
r = Role.find_by(name: role)
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
|
||||
next if Member.where(principal: u, project: p).exists?
|
||||
|
||||
as_admin do
|
||||
Member.new.tap do |m|
|
||||
m.principal = u
|
||||
m.roles << r
|
||||
m.project = p
|
||||
end.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^there is a [rR]ole "([^\"]*)"$/ do |name, _table = nil|
|
||||
FactoryBot.create(:role, name: name) unless Role.find_by(name: name)
|
||||
end
|
||||
|
||||
Given /^there is a [rR]ole "([^\"]*)" with the following permissions:?$/ do |name, table|
|
||||
FactoryBot.create(:role, name: name, permissions: table.raw.flatten) unless Role.find_by(name: name)
|
||||
end
|
||||
|
||||
Given /^there are the following roles:$/ do |table|
|
||||
table.raw.flatten.each do |name|
|
||||
FactoryBot.create(:role, name: name) unless Role.find_by(name: name)
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [rR]ole "([^\"]*)" may have the following [rR]ights:$/ do |role, table|
|
||||
r = Role.find_by(name: role)
|
||||
raise "No such role was defined: #{role}" unless r
|
||||
as_admin do
|
||||
available_perms = OpenProject::AccessControl.permissions.map(&:name)
|
||||
r.permissions = []
|
||||
|
||||
table.raw.each do |_perm|
|
||||
perm = _perm.first
|
||||
unless perm.blank?
|
||||
perm = perm.gsub(' ', '_').underscore.to_sym
|
||||
if available_perms.include?(:"#{perm}")
|
||||
r.add_permission! perm
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
r.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [rR]ole "(.+?)" has no (?:[Pp]ermissions|[Rr]ights)$/ do |role_name|
|
||||
role = Role.find_by(name: role_name)
|
||||
raise "No such role was defined: #{role_name}" unless role
|
||||
as_admin do
|
||||
role.permissions = []
|
||||
role.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the user "(.*?)" is a "([^\"]*?)"$/ do |user, role|
|
||||
step %{the user "#{user}" is a "#{role}" in the project "#{get_project.name}"}
|
||||
end
|
||||
@@ -1,108 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given(/^there are (\d+) work packages with "(.*?)" in their description$/) do |num, desc|
|
||||
work_packages = FactoryBot.create_list :work_package, num.to_i, description: desc
|
||||
time = Time.now
|
||||
# ensure temporal order:
|
||||
work_packages.reverse.each_with_index do |wp, i|
|
||||
wp.created_at = time - i.seconds
|
||||
wp.save
|
||||
end
|
||||
|
||||
@search_work_packages = work_packages
|
||||
end
|
||||
|
||||
Then(/^I can see the (\d+(?:st|nd|rd|th)) through (\d+(?:st|nd|rd|th)) of those work packages$/) do |from, to|
|
||||
from = from.to_i - 1
|
||||
to = to.to_i - 1
|
||||
count = (to - from).abs + 1
|
||||
|
||||
found_wps = page.all(:css, 'dt.work_package-edit')
|
||||
expect(found_wps.size).to eq(count)
|
||||
|
||||
expected_wps = @search_work_packages[from..to]
|
||||
expect(expected_wps.size).to eq(count)
|
||||
|
||||
expected_wps.each do |wp|
|
||||
path = Rails.application.routes.url_helpers.work_package_path(wp)
|
||||
linked = found_wps.any? { |e|
|
||||
e.find('a')['href'].include? path
|
||||
}
|
||||
expect(linked).to be(true)
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I search globally for "([^"]*)"$/) do |query|
|
||||
steps %{
|
||||
And I click link "#top-menu-search-button"
|
||||
And I fill in "#{query}" for "q"
|
||||
And I press the "return" key on element "#q"
|
||||
And I wait for the AJAX requests to finish
|
||||
}
|
||||
end
|
||||
|
||||
When(/^I search for "([^"]*)" after having searched$/) do |query|
|
||||
steps %{
|
||||
And I click link "#top-menu-search-button"
|
||||
And I fill in "#{query}" for "q" within "#content"
|
||||
And I press "Submit" within "#content"
|
||||
And I wait for the AJAX requests to finish
|
||||
}
|
||||
end
|
||||
|
||||
When(/^there are pagination links$/) do
|
||||
links = page.all(:css, '.search-pagination a')
|
||||
|
||||
if links.size == 2
|
||||
@search_previous_url = links.first['href']
|
||||
@search_next_url = links.last['href']
|
||||
elsif links.size == 1
|
||||
@search_previous_url = nil
|
||||
@search_next_url = links.first['href']
|
||||
else
|
||||
fail 'There are no pagination links!'
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I turn over to the previous results page$/) do
|
||||
expect(@search_previous_url).not_to be(nil)
|
||||
visit @search_previous_url
|
||||
end
|
||||
|
||||
When(/^I turn over to the next results page$/) do
|
||||
expect(@search_next_url).not_to be(nil)
|
||||
visit @search_next_url
|
||||
end
|
||||
|
||||
When /^I click on a search result pagination link$/ do
|
||||
within all('.search-pagination').first do
|
||||
click_link 'Next'
|
||||
end
|
||||
end
|
||||
@@ -1,112 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the rest api is enabled$/ do
|
||||
Setting.rest_api_enabled = '1'
|
||||
|
||||
Support::Cleanup.to_clean Support::ClearCache.clear
|
||||
end
|
||||
|
||||
Given /^the following languages are available:$/ do |table|
|
||||
Setting.available_languages += table.raw.map(&:first)
|
||||
|
||||
Support::Cleanup.to_clean Support::ClearCache.clear
|
||||
end
|
||||
|
||||
# Given /^the "(.+?)" setting is set to (true|false)$/ do |name, trueish|
|
||||
# Setting[name.to_sym] = (trueish == "true" ? "1" : "0")
|
||||
# end
|
||||
|
||||
Given /^the "(.+?)" setting is set to (.+)$/ do |name, value|
|
||||
value = case value
|
||||
when 'true'
|
||||
'1'
|
||||
when 'false'
|
||||
'0'
|
||||
else
|
||||
value
|
||||
end
|
||||
|
||||
value = value.to_i if Setting.available_settings[name]['format'] == 'int'
|
||||
|
||||
Setting[name.to_sym] = value
|
||||
|
||||
Support::ClearCache.clear_after
|
||||
end
|
||||
|
||||
Then /^the "(.+?)" setting should be (true|false)$/ do |name, trueish|
|
||||
Setting.send((name + '?').to_sym).should == (trueish == 'true')
|
||||
end
|
||||
|
||||
Given /^I save the settings$/ do
|
||||
click_button('Save')
|
||||
|
||||
Support::ClearCache.clear_after
|
||||
end
|
||||
|
||||
##
|
||||
# Setting-specific steps
|
||||
#
|
||||
|
||||
#
|
||||
# Directly write to Settings
|
||||
#
|
||||
Given /^users are blocked for ([0-9]+) minutes after ([0-9]+) failed login attempts$/ do |duration, attempts|
|
||||
Setting.brute_force_block_minutes = duration
|
||||
Setting.brute_force_block_after_failed_logins = attempts
|
||||
|
||||
Support::ClearCache.clear_after
|
||||
end
|
||||
|
||||
Given /^we paginate after (\d+) items$/ do |per_page_param|
|
||||
Setting.per_page_options = "#{per_page_param}, 50, 100"
|
||||
|
||||
Support::ClearCache.clear_after
|
||||
end
|
||||
|
||||
#
|
||||
# Fill out settings forms
|
||||
#
|
||||
Given /^I set passwords to expire after ([0-9]+) days$/ do |days|
|
||||
visit '/settings?tab=authentication'
|
||||
fill_in('settings_password_days_valid', with: days.to_s)
|
||||
step 'I save the settings'
|
||||
|
||||
Support::ClearCache.clear_after
|
||||
end
|
||||
|
||||
module Support
|
||||
module ClearCache
|
||||
def self.clear_after
|
||||
Support::Cleanup.to_clean do
|
||||
Rails.cache.clear
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,44 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^there is a(?:n)? (default )?(?:issue)?status with:$/ do |default, table|
|
||||
name = table.raw.find { |ary| ary.include? 'name' }[table.raw.first.index('name') + 1].to_s
|
||||
Status.find_by(name: name) || Status.create(name: name.to_s, is_default: !!default)
|
||||
end
|
||||
|
||||
Given /^there are the following status:$/ do |table|
|
||||
table.hashes.each do |row|
|
||||
attributes = row.inject({}) { |mem, (k, v)| mem[k.to_sym] = v if v.present?; mem }
|
||||
attributes[:is_default] = attributes.delete(:default) == 'true'
|
||||
|
||||
FactoryBot.create(:status, attributes)
|
||||
end
|
||||
end
|
||||
|
||||
InstanceFinder.register(Status, Proc.new { |name| Status.find_by(name: name) })
|
||||
@@ -1,73 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given(/^there is a time entry for "(.*?)" with (\d+) hours$/) do |subject, hours|
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
time_entry = FactoryBot.create(:time_entry, work_package: work_package, hours: hours, project: work_package.project)
|
||||
end
|
||||
|
||||
Given(/^there is an activity "(.*?)"$/) do |name|
|
||||
FactoryBot.create(:time_entry_activity, name: name)
|
||||
end
|
||||
|
||||
When(/^I log (\d+) hours with the comment "(.*?)"$/) do |hours, comment|
|
||||
click_link I18n.t(:button_log_time)
|
||||
fill_in TimeEntry.human_attribute_name(:hours), with: hours
|
||||
fill_in TimeEntry.human_attribute_name(:comment), with: comment
|
||||
select 'Development', from: 'Activity'
|
||||
click_button I18n.t(:button_save)
|
||||
end
|
||||
|
||||
Then(/^I should see a time entry with (\d+) hours and comment "(.*)"$/) do |hours, comment|
|
||||
expect(page).to have_content("#{hours}.00")
|
||||
expect(page).to have_content(comment)
|
||||
end
|
||||
|
||||
Then(/^I should (not )?see a total spent time of (\d+) hours$/) do |negative, hours|
|
||||
available = find('div.total-hours') rescue false
|
||||
|
||||
if available || !negative
|
||||
within('div.total-hours') do
|
||||
element = find('span.hours-int')
|
||||
|
||||
if negative
|
||||
expect(element).not_to have_content hours
|
||||
else
|
||||
expect(element).to have_content hours
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I update the first time entry with (\d+) hours and the comment "(.*?)"$/) do |hours, comment|
|
||||
click_link I18n.t('button_edit')
|
||||
fill_in TimeEntry.human_attribute_name(:hours), with: hours
|
||||
fill_in TimeEntry.human_attribute_name(:comment), with: comment
|
||||
click_button 'Save'
|
||||
end
|
||||
@@ -1,78 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given(/^the time is ([0-9]+) minutes earlier$/) do |duration|
|
||||
Timecop.travel(Time.now - duration.to_i.minutes)
|
||||
|
||||
# Ensure timecop returns after each scenario
|
||||
Support::ResetTimecop.reset_after
|
||||
end
|
||||
|
||||
Given(/^the time is ([0-9]+) days earlier$/) do |duration|
|
||||
Timecop.travel(Time.now - duration.to_i.days)
|
||||
|
||||
# Ensure timecop returns after each scenario
|
||||
Support::ResetTimecop.reset_after
|
||||
end
|
||||
|
||||
Given(/^the time is ([0-9]+) minutes later$/) do |duration|
|
||||
Timecop.travel(Time.now + duration.to_i.minutes)
|
||||
|
||||
# Ensure timecop returns after each scenario
|
||||
Support::ResetTimecop.reset_after
|
||||
end
|
||||
|
||||
Given(/^the time is ([0-9]+) days later$/) do |duration|
|
||||
Timecop.travel(Time.now + duration.to_i.days)
|
||||
|
||||
# Ensure timecop returns after each scenario
|
||||
Support::ResetTimecop.reset_after
|
||||
end
|
||||
|
||||
Given(/^the date is "(.*?)"$/) do |date|
|
||||
new_time = Time.parse date
|
||||
Timecop.travel(new_time)
|
||||
|
||||
# Ensure timecop returns after each scenario
|
||||
Support::ResetTimecop.reset_after
|
||||
end
|
||||
|
||||
Given(/^the date is today$/) do
|
||||
Timecop.return
|
||||
end
|
||||
|
||||
module Support
|
||||
module ResetTimecop
|
||||
def self.reset_after
|
||||
Support::Cleanup.to_clean do
|
||||
Timecop.return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,53 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# change from symbol to constant once namespace is removed
|
||||
|
||||
InstanceFinder.register(::Type, Proc.new { |name| ::Type.find_by(name: name) })
|
||||
|
||||
RouteMap.register(::Type, '/types')
|
||||
|
||||
Given /^the following types are enabled for the project called "(.*?)":$/ do |project_name, type_name_table|
|
||||
types = type_name_table.raw.flatten.map { |type_name|
|
||||
::Type.find_by(name: type_name) || FactoryBot.create(:type, name: type_name)
|
||||
}
|
||||
|
||||
project = Project.find_by(identifier: project_name)
|
||||
project.types = types
|
||||
project.save!
|
||||
end
|
||||
|
||||
Then /^I should not see the "([^"]*)" type$/ do |name|
|
||||
page.all(:css, '.timelines-pet-name', text: name).should be_empty
|
||||
end
|
||||
|
||||
Then /^I should see the "([^"]*)" type$/ do |name|
|
||||
expect(page)
|
||||
.to have_selector(:css, '.timelines-pet-name', text: name)
|
||||
end
|
||||
@@ -1,153 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
InstanceFinder.register(User, Proc.new { |name| User.find_by_login(name) })
|
||||
|
||||
##
|
||||
# Editing/creating users (admin UI)
|
||||
#
|
||||
#
|
||||
|
||||
When /^I create a new user$/ do
|
||||
visit '/users/new'
|
||||
fill_in('user_login', with: 'newbobby')
|
||||
fill_in('user_firstname', with: 'newbobby')
|
||||
fill_in('user_lastname', with: 'newbobby')
|
||||
fill_in('user_mail', with: 'newbobby@example.com')
|
||||
end
|
||||
|
||||
When /^I edit the user "([^\"]*)"$/ do |user|
|
||||
user_id = User.find_by_login(user).id
|
||||
visit "/users/#{user_id}/edit"
|
||||
end
|
||||
|
||||
When /^I assign the user "([^\"]*)" a random password$/ do |user|
|
||||
step "I edit the user \"#{user}\""
|
||||
step 'I check the assign random password to user field'
|
||||
step 'I save the user'
|
||||
end
|
||||
|
||||
When /^I check the assign random password to user field$/ do
|
||||
check(I18n.t(:assign_random_password, scope: :user))
|
||||
end
|
||||
|
||||
Given /^I save the user$/ do
|
||||
click_button('Save')
|
||||
end
|
||||
|
||||
Given /^I save the new user$/ do
|
||||
click_button('Create', exact: true)
|
||||
end
|
||||
|
||||
##
|
||||
# Creating users (on the DB)
|
||||
#
|
||||
Given /^there is 1 [Uu]ser with(?: the following)?:$/ do |table|
|
||||
login = table.rows_hash[:Login].to_s + table.rows_hash[:login].to_s
|
||||
user = User.find_by_login(login) unless login.blank?
|
||||
|
||||
if !user
|
||||
user = FactoryBot.create(:user)
|
||||
user.pref
|
||||
user.password = user.password_confirmation = nil
|
||||
end
|
||||
|
||||
modify_user(user, table)
|
||||
end
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" has:$/ do |user, table|
|
||||
u = User.find_by_login(user)
|
||||
raise "No such user: #{user}" unless u
|
||||
modify_user(u, table)
|
||||
end
|
||||
|
||||
Given /^the [Uu]ser "([^\"]*)" has the following preferences$/ do |user, table|
|
||||
u = User.find_by_login(user)
|
||||
|
||||
send_table_to_object(u.pref, table)
|
||||
end
|
||||
|
||||
Given /^the user "([^\"]*)" is locked$/ do |user|
|
||||
User.find_by_login(user).lock!
|
||||
end
|
||||
|
||||
Given /^the user "([^\"]*)" is registered and not activated$/ do |user|
|
||||
User.find_by_login(user).register!
|
||||
end
|
||||
|
||||
Given /^the user "([^\"]*)" had too many recently failed logins$/ do |user|
|
||||
user = User.find_by_login(user)
|
||||
user.failed_login_count = 100
|
||||
user.last_failed_login_on = Time.now
|
||||
user.save
|
||||
end
|
||||
|
||||
Given /^there are the following users:$/ do |table|
|
||||
table.raw.flatten.each do |login|
|
||||
FactoryBot.create(:user, login: login)
|
||||
end
|
||||
end
|
||||
|
||||
Given /^there is a user named "([^\"]+)"$/ do |user|
|
||||
steps %{
|
||||
Given there are the following users:
|
||||
| #{user} |
|
||||
}
|
||||
end
|
||||
|
||||
Then /^there should be a user with the following:$/ do |table|
|
||||
expected = table.rows_hash
|
||||
|
||||
user = User.find_by_login(expected['login'])
|
||||
|
||||
user.should_not be_nil
|
||||
|
||||
expected.each do |key, value|
|
||||
user.send(key).should == value
|
||||
end
|
||||
end
|
||||
|
||||
Given 'journals are not being aggregated' do
|
||||
Setting.journal_aggregation_time_minutes = 0
|
||||
end
|
||||
|
||||
##
|
||||
# admin users list
|
||||
#
|
||||
When /^I filter the users list by status "([^\"]+)"$/ do |status|
|
||||
visit('/users')
|
||||
select(status, from: 'Status:')
|
||||
click_on "Apply"
|
||||
end
|
||||
|
||||
Given(/^I click the (\w+) access key reset link$/) do |access_key_type|
|
||||
within '#access-token-table' do
|
||||
find('tr', text: "#{access_key_type} access key").click_link('Reset')
|
||||
end
|
||||
end
|
||||
@@ -1,42 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
InstanceFinder.register(Version, Proc.new { |name| Version.find_by(name: name) })
|
||||
|
||||
Given /^the [Pp]roject (.+) has 1 version with(?: the following)?:$/ do |project, table|
|
||||
project.gsub!("\"", '')
|
||||
p = Project.find_by(name: project) || Project.find_by(identifier: project)
|
||||
|
||||
as_admin do
|
||||
v = FactoryBot.build(:version) { |v|
|
||||
v.project = p
|
||||
}
|
||||
send_table_to_object(v, table)
|
||||
end
|
||||
end
|
||||
@@ -1,436 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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 'uri'
|
||||
require 'cgi'
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'support', 'paths'))
|
||||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'support', 'selectors'))
|
||||
|
||||
module WithinHelpers
|
||||
def press_key_on_element(key, element)
|
||||
page.find(element).native.send_keys(Selenium::WebDriver::Keys[key.to_sym])
|
||||
end
|
||||
|
||||
def right_click(elements)
|
||||
builder = page.driver.browser.action
|
||||
|
||||
Array(elements).each do |e|
|
||||
builder.context_click(e.native)
|
||||
end
|
||||
|
||||
builder.perform
|
||||
end
|
||||
|
||||
def ctrl_click(elements)
|
||||
builder = page.driver.browser.action
|
||||
|
||||
# Hold control key down
|
||||
builder.key_down(:control)
|
||||
|
||||
# Note that you can retrieve the elements using capybara's
|
||||
# standard methods. When passing them to the builder
|
||||
# make sure to do .native
|
||||
Array(elements).each do |e|
|
||||
builder.click(e.native)
|
||||
end
|
||||
|
||||
# Release control key
|
||||
builder.key_up(:control)
|
||||
|
||||
# Do the action setup
|
||||
builder.perform
|
||||
end
|
||||
|
||||
def with_scope(locator, options = {})
|
||||
locator ? within(*selector_for(locator), options) { yield } : yield
|
||||
end
|
||||
end
|
||||
World(WithinHelpers)
|
||||
|
||||
# Single-line step scoper
|
||||
When /^(.*) within "(.*[^:"])"$/ do |step_name, parent|
|
||||
with_scope(parent) { step step_name }
|
||||
end
|
||||
|
||||
When /^(.*) \[i18n\]$/ do |actual_step|
|
||||
step translate(actual_step)
|
||||
end
|
||||
|
||||
When(/^I ctrl\-click on "([^\"]+)"$/) do |text|
|
||||
# Click all elements that you want, in this case we click all as
|
||||
elements = page.all('a', text: text)
|
||||
ctrl_click(elements)
|
||||
end
|
||||
|
||||
# Single-line step scoper
|
||||
When /^(.*) within_hidden (.*[^:])$/ do |step_name, parent|
|
||||
with_scope(parent, visible: false) { step step_name }
|
||||
end
|
||||
|
||||
# Multi-line step scoper
|
||||
When /^(.*) within (.*[^:]):$/ do |step_name, parent, table_or_string|
|
||||
with_scope(parent) { step "#{step_name}:", table_or_string }
|
||||
end
|
||||
|
||||
Given /^(?:|I )am on (.+)$/ do |page_name|
|
||||
visit path_to(page_name)
|
||||
end
|
||||
|
||||
When /^(?:|I )go to (.+)$/ do |page_name|
|
||||
visit path_to(page_name)
|
||||
end
|
||||
|
||||
When /^(?:|I )press "([^"]*)"$/ do |button|
|
||||
click_button(button)
|
||||
end
|
||||
|
||||
When /^(?:|I )follow "([^"]*)"$/ do |link|
|
||||
click_link(link)
|
||||
end
|
||||
|
||||
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
|
||||
fill_in(field, with: value)
|
||||
end
|
||||
|
||||
When /^(?:|I )fill in "([^"]*)" for "([^"]*)"$/ do |value, field|
|
||||
fill_in(field, with: value)
|
||||
end
|
||||
|
||||
# Use this to fill in an entire form with data from a table. Example:
|
||||
#
|
||||
# When I fill in the following:
|
||||
# | Account Number | 5002 |
|
||||
# | Expiry date | 2009-11-01 |
|
||||
# | Note | Nice guy |
|
||||
# | Wants Email? | |
|
||||
#
|
||||
# TODO: Add support for checkbox and option
|
||||
# based on naming conventions.
|
||||
#
|
||||
When /^(?:|I )fill in the following:$/ do |fields|
|
||||
fields.rows_hash.each do |name, value|
|
||||
field = find_field(name)
|
||||
|
||||
if field.tag_name == 'select'
|
||||
step(%{I select "#{value}" from "#{name}"})
|
||||
else
|
||||
step(%{I fill in "#{name}" with "#{value}"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
When (/^I do some ajax$/) do
|
||||
click_link('Apply')
|
||||
end
|
||||
|
||||
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
|
||||
select(value, from: field)
|
||||
end
|
||||
|
||||
When /^(?:|I )check "([^"]*)"$/ do |field|
|
||||
check(field)
|
||||
end
|
||||
|
||||
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
|
||||
uncheck(field)
|
||||
end
|
||||
|
||||
When /^(?:|I )choose "([^"]*)"$/ do |field|
|
||||
choose(field)
|
||||
end
|
||||
|
||||
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
|
||||
attach_file(field, File.expand_path(path))
|
||||
end
|
||||
|
||||
Then /^(?:|I )should see "([^"]*)"$/ do |text|
|
||||
regexp = Regexp.new(Regexp.escape(text), Regexp::IGNORECASE)
|
||||
page.should have_content(regexp)
|
||||
end
|
||||
|
||||
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
||||
regexp = Regexp.new(regexp)
|
||||
|
||||
should have_content(regexp)
|
||||
end
|
||||
|
||||
Then(/^(?:|I )should not see "([^"]*)" in the same table row as "([^"]*)"$/) do |text1, text2|
|
||||
within('table.generic-table tbody') do
|
||||
page.all(:xpath, "//tr/td[contains(.,'#{text2}')]/following-sibling::td").each do |td|
|
||||
expect(td).to have_no_content(text1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
|
||||
regexp = Regexp.new(Regexp.escape(text), Regexp::IGNORECASE)
|
||||
page.should have_no_content(regexp)
|
||||
end
|
||||
|
||||
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
||||
regexp = Regexp.new(regexp)
|
||||
|
||||
should have_no_content(regexp)
|
||||
end
|
||||
|
||||
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
|
||||
with_scope(parent) do
|
||||
field = find_field(field)
|
||||
field.value.should =~ /#{value}/
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
||||
with_scope(parent) do
|
||||
field = find_field(field)
|
||||
field.value.should_not =~ /#{value}/
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "([^"]*)" field should have the error "([^"]*)"$/ do |field, error_message|
|
||||
element = find_field(field)
|
||||
classes = element.find(:xpath, '..')[:class].split(' ')
|
||||
|
||||
form_for_input = element.find(:xpath, 'ancestor::form[1]')
|
||||
using_formtastic = form_for_input[:class].include?('formtastic')
|
||||
error_class = using_formtastic ? 'error' : 'field_with_errors'
|
||||
|
||||
classes.should include(error_class)
|
||||
|
||||
if using_formtastic
|
||||
error_paragraph = element.find(:xpath, '../*[@class="inline-errors"][1]')
|
||||
error_paragraph.should have_content(error_message)
|
||||
else
|
||||
page.should have_content("#{field.titlecase} #{error_message}")
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the "([^"]*)" field should have no error$/ do |field|
|
||||
element = find_field(field)
|
||||
classes = element.find(:xpath, '..')[:class].split(' ')
|
||||
classes.should_not include('field_with_errors')
|
||||
classes.should_not include('error')
|
||||
end
|
||||
|
||||
Then /^the (hidden )?"([^"]*)" checkbox should be checked$/ do |hidden, label|
|
||||
field_checked = find_field(label, visible: hidden.nil?)['checked']
|
||||
field_checked.should be_truthy
|
||||
end
|
||||
|
||||
Then /^the (hidden )?"([^"]*)" checkbox should not be checked$/ do |hidden, label|
|
||||
field_checked = find_field(label, visible: hidden.nil?)['checked']
|
||||
field_checked.should be_falsey
|
||||
end
|
||||
|
||||
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
||||
current_path = URI.parse(current_url).path
|
||||
CGI.unescape(current_path).should == CGI.unescape(path_to(page_name))
|
||||
end
|
||||
|
||||
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
||||
query = URI.parse(current_url).query
|
||||
actual_params = query ? CGI.parse(query) : {}
|
||||
expected_params = {}
|
||||
expected_pairs.rows_hash.each_pair { |k, v| expected_params[k] = v.split(',') }
|
||||
|
||||
actual_params.should == expected_params
|
||||
end
|
||||
|
||||
Then /^show me the page$/ do
|
||||
# save_and_open_page
|
||||
sleep 2 # sleep to ensure page has been fully loaded
|
||||
save_and_open_screenshot
|
||||
end
|
||||
|
||||
# newly generated until here
|
||||
|
||||
When /^I wait(?: (\d+) seconds)? for(?: the)? [Aa][Jj][Aa][Xx](?: requests?(?: to finish)?)?$/ do |timeout|
|
||||
ajax_done = lambda do
|
||||
is_done = false
|
||||
while !is_done
|
||||
is_done = page.evaluate_script(%{
|
||||
(function (){
|
||||
return !(window.jQuery && document.ajaxActive);
|
||||
}())
|
||||
}.gsub("\n", ''))
|
||||
end
|
||||
end
|
||||
|
||||
timeout = timeout.present? ?
|
||||
timeout.to_f :
|
||||
5.0
|
||||
|
||||
wait_until(timeout, i_know_im_immoral: true) do
|
||||
ajax_done.call
|
||||
end
|
||||
end
|
||||
|
||||
Then /^there should be a( disabled)? "(.+)" field( visible| invisible)?$/ do |disabled, fieldname, visible|
|
||||
# Checking for a disabled field will only work for field with labels where the label
|
||||
# has a correctly filled "for" attribute
|
||||
visibility = visible && !visible.include?('invisible')
|
||||
|
||||
if disabled
|
||||
# disabled fields can not be found via find_field
|
||||
field_id = find('label', text: fieldname)['for']
|
||||
should have_css("##{field_id}", visible: visibility)
|
||||
else
|
||||
should have_field(fieldname, visible: visibility)
|
||||
end
|
||||
end
|
||||
|
||||
Then /^there should not be a "(.+)" field$/ do |fieldname|
|
||||
should_not have_field(fieldname)
|
||||
end
|
||||
|
||||
Then /^there should be a "(.+)" button$/ do |button_label|
|
||||
page.should have_xpath("//input[@value='#{button_label}']")
|
||||
end
|
||||
|
||||
Then /^the "([^\"]*)" select(?: within "([^\"]*)")? should have the following options:$/ do |field, selector, option_table|
|
||||
options_expected = option_table.raw.flatten
|
||||
|
||||
with_scope(selector) do
|
||||
field = find_field(field)
|
||||
options_actual = field.all('option').map(&:text)
|
||||
options_actual.should =~ options_expected
|
||||
end
|
||||
end
|
||||
|
||||
Then /^there should be the disabled "(.+)" element$/ do |element|
|
||||
page.find(element)[:disabled].should == 'true'
|
||||
end
|
||||
|
||||
Then /^the element "(.+)" should be invalid$/ do |element|
|
||||
expect(page).to have_selector("#{element}:invalid")
|
||||
end
|
||||
|
||||
# This needs an active js driver to work properly
|
||||
Given /^I (accept|dismiss) the alert dialog$/ do |method|
|
||||
if Capybara.current_driver.to_s.include?('selenium')
|
||||
page.driver.browser.switch_to.alert.send(method.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^(.*) in the new window$/) do |step|
|
||||
new_window = windows.last
|
||||
page.within_window new_window do
|
||||
step(step)
|
||||
end
|
||||
end
|
||||
|
||||
Then /^(.*) in the iframe "([^\"]+)"$/ do |step, iframe_name|
|
||||
browser = page.driver.browser
|
||||
browser.switch_to.frame(iframe_name)
|
||||
step(step)
|
||||
browser.switch_to.default_content
|
||||
end
|
||||
|
||||
When /^(?:|I )click the toolbar button named "(.*?)"$/ do |action_name|
|
||||
find('.toolbar-container').click_button action_name
|
||||
end
|
||||
|
||||
When /^(?:|I )choose "(.*?)" from the toolbar "(.*?)" dropdown$/ do |action_name, dropdown_id|
|
||||
find("button[has-dropdown-menu][target=#{dropdown_id}DropdownMenu]").click
|
||||
find("##{dropdown_id}Dropdown").click_link action_name
|
||||
end
|
||||
|
||||
# that's capybara's old behaviour: clicking the first button that matches
|
||||
When /^(?:|I )click on the first button matching "([^"]*)"$/ do |button|
|
||||
first(:button, button).click
|
||||
end
|
||||
|
||||
When /^(?:|I )follow the first link matching "([^"]*)"$/ do |link|
|
||||
first(:link, link).click
|
||||
end
|
||||
|
||||
When /^(?:|I )click on the first anchor matching "([^"]*)"$/ do |anchor|
|
||||
find(:xpath, "(//a[text()='#{anchor}'])[1]").click
|
||||
end
|
||||
|
||||
def find_lowest_containing_element(text, selector)
|
||||
elements = []
|
||||
|
||||
node_criteria = "[contains(normalize-space(.), \"#{text}\") and not(self::script) and not(child::*[contains(normalize-space(.), \"#{text}\")])]"
|
||||
|
||||
if selector
|
||||
search_string = Nokogiri::CSS.xpath_for(selector).first + "//*#{node_criteria}"
|
||||
search_string += ' | ' + Nokogiri::CSS.xpath_for(selector).first + "#{node_criteria}"
|
||||
else
|
||||
search_string = "//*#{node_criteria}"
|
||||
end
|
||||
elements = all(:xpath, search_string)
|
||||
|
||||
rescue Nokogiri::CSS::SyntaxError
|
||||
elements
|
||||
end
|
||||
|
||||
require 'timeout'
|
||||
|
||||
def wait_until(seconds = 5, options = {}, &block)
|
||||
unless options[:i_know_im_immoral]
|
||||
raise "You are immoral. I can't stand this. Goodbye.
|
||||
|
||||
You really shouldn't use wait_until and wait for an element
|
||||
using Capybara instead, e.g. using page.should have_selector(...)
|
||||
See http://www.elabs.se/blog/53-why-wait_until-was-removed-from-capybara
|
||||
"
|
||||
end
|
||||
Timeout.timeout(seconds, &block)
|
||||
end
|
||||
|
||||
When /^I confirm popups$/ do
|
||||
page.driver.browser.switch_to.alert.accept
|
||||
end
|
||||
|
||||
# Needs Selenium!
|
||||
Then(/^I should( not )?see a(?:n) alert dialog$/) do |negative|
|
||||
negative = !!negative
|
||||
if Capybara.current_driver.to_s.include?('selenium')
|
||||
begin
|
||||
page.driver.browser.switch_to.alert
|
||||
expect(negative).to eq(false)
|
||||
rescue Selenium::WebDriver::Error::NoSuchAlertError
|
||||
expect(negative).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^I should see a confirm dialog$/) do
|
||||
page.should have_selector('#confirm_dialog')
|
||||
end
|
||||
|
||||
Then /^I confirm the JS confirm dialog$/ do
|
||||
page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoAlertOpenError
|
||||
end
|
||||
|
||||
Then /^I should see a JS confirm dialog$/ do
|
||||
page.driver.browser.switch_to.alert.text.should_not be_nil
|
||||
page.driver.browser.switch_to.alert.accept
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the wiki menu item of the wiki page "(.*?)" of project "(.*?)" has been deleted$/ do |item_name, project_name|
|
||||
project = Project.find_by name: project_name
|
||||
WikiPage.where(title: item_name, wiki_id: project.wiki.id).first.delete_wiki_menu_item
|
||||
end
|
||||
@@ -1,103 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^the [Pp]roject "([^\"]*)" has 1 [wW]iki(?: )?[pP]age with the following:$/ do |project, table|
|
||||
p = Project.find_by(name: project)
|
||||
|
||||
p.wiki = Wiki.create unless p.wiki
|
||||
|
||||
page = FactoryBot.create(:wiki_page, wiki: p.wiki)
|
||||
content = FactoryBot.create(:wiki_content, page: page)
|
||||
|
||||
send_table_to_object(page, table)
|
||||
end
|
||||
|
||||
Given /^there are no wiki menu items$/ do
|
||||
MenuItems::WikiMenuItem.destroy_all
|
||||
end
|
||||
|
||||
Given /^the project "(.*?)" has (?:1|a) wiki menu item with the following:$/ do |project_name, table|
|
||||
item = FactoryBot.build(:wiki_menu_item)
|
||||
send_table_to_object(item, table)
|
||||
item.wiki = Project.find_by(name: project_name).wiki
|
||||
item.save!
|
||||
end
|
||||
|
||||
Given /^the project "(.*?)" has a child wiki page of "(.*?)" with the following:$/ do |project_name, parent_page_title, table|
|
||||
wiki = Project.find_by(name: project_name).wiki
|
||||
wikipage = FactoryBot.build(:wiki_page, wiki: wiki)
|
||||
|
||||
send_table_to_object(wikipage, table)
|
||||
|
||||
FactoryBot.create(:wiki_content, page: wikipage)
|
||||
|
||||
parent_page = WikiPage.find_by(wiki_id: wiki.id, title: parent_page_title)
|
||||
wikipage.parent_id = parent_page.id
|
||||
wikipage.save!
|
||||
end
|
||||
|
||||
Then /^the table of contents wiki menu item inside the "(.*?)" menu item should be selected$/ do |parent_item_name|
|
||||
parent_item = MenuItems::WikiMenuItem.find_by(title: parent_item_name)
|
||||
|
||||
page.should have_css(".#{parent_item.item_class}-toc-menu-item.selected")
|
||||
end
|
||||
|
||||
Then /^the child page wiki menu item inside the "(.*?)" menu item should be selected$/ do |parent_item_name|
|
||||
parent_item = MenuItems::WikiMenuItem.find_by(title: parent_item_name)
|
||||
|
||||
page.should have_css(".#{parent_item.item_class}-new-page-menu-item.selected")
|
||||
end
|
||||
|
||||
Given /^the wiki page "([^"]*)" of the project "([^"]*)" has the following contents:$/ do |page, project, table|
|
||||
project = Project.find_by name: project
|
||||
wiki = project.wiki || Wiki.create
|
||||
wp = wiki.pages.find_or_create_by(title: page)
|
||||
wc = wp.content || wp.create_content
|
||||
wc.update_attribute(:text, table.raw.first)
|
||||
end
|
||||
|
||||
Given /^the wiki page "([^"]*)" of the project "([^"]*)" has (\d+) versions{0,1}$/ do |page, project, version_count|
|
||||
project = Project.find_by name: project
|
||||
wiki = project.wiki
|
||||
wp = wiki.pages.find_or_create_by(title: page)
|
||||
wp.save! unless wp.persisted?
|
||||
wc = wp.content || FactoryBot.create(:wiki_content, page: wp)
|
||||
|
||||
last_version = wc.journals.max(&:version).version
|
||||
|
||||
version_count.to_i.times.each do |v|
|
||||
version = last_version + v + 1
|
||||
data = FactoryBot.build(:journal_wiki_content_journal,
|
||||
text: "This is version #{version}")
|
||||
FactoryBot.create(:wiki_content_journal,
|
||||
version: version,
|
||||
data: data,
|
||||
journable_id: wc.id)
|
||||
end
|
||||
end
|
||||
@@ -1,59 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given(/^the work package "(.*?)" has the following changesets:$/) do |subject, table|
|
||||
wp = WorkPackage.find_by!(subject: subject)
|
||||
|
||||
repo = wp.project.repository
|
||||
|
||||
wp_changesets = table.hashes.map { |row|
|
||||
FactoryBot.build(:changeset, row.merge(repository: repo))
|
||||
}
|
||||
|
||||
wp.changesets = wp_changesets
|
||||
end
|
||||
|
||||
Then(/^I should see the following changesets:$/) do |table|
|
||||
unless (unsupported = table.headers - ['revision', 'comments']).empty?
|
||||
raise ArgumentError, "#{unsupported.join(', ')} is unsupported. But you can change that."
|
||||
end
|
||||
|
||||
table.hashes.each do |row|
|
||||
# this will only work with one revision as we do not have proper markup
|
||||
# to identify different changesets
|
||||
within('.work-package-details-activities-list .revision-activity--revision-link') do
|
||||
expect(page).to have_content("committed revision #{row[:revision]}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^I should not be presented changesets$/) do
|
||||
expect(page)
|
||||
.not_to have_selector('.work-package-details-activities-list .revision-activity--revision-link')
|
||||
end
|
||||
@@ -1,78 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
When (/^I fill in a (\d+) hash(?:es)? quickinfo link to "([^"]*)" for "([^"]*)"$/) do |count, subject, container|
|
||||
count = count.to_i
|
||||
|
||||
raise 'Only values between 1 and 3 are allowed for hashes' if count < 1 || count > 3
|
||||
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
text = "#{('#' * count)}#{work_package.id}"
|
||||
|
||||
step %{I fill in "#{text}" for "#{container}"}
|
||||
end
|
||||
|
||||
When (/^I follow the (\d+) hash(?:es)? work package quickinfo link to "([^"]*)"$/) do |count, subject|
|
||||
count = count.to_i
|
||||
raise 'Only values between 1 and 3 are allowed for hashes' if count < 1 || count > 3
|
||||
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
|
||||
text = case count
|
||||
when 1
|
||||
"##{work_package.id}"
|
||||
when 2, 3
|
||||
"#{work_package.type} ##{work_package.id}".strip
|
||||
end
|
||||
|
||||
step %{I follow "#{text}"}
|
||||
end
|
||||
|
||||
Then /^I should (not )?see a (\d+) hash(?:es)? work package quickinfo link to "([^"]*)"$/ do |negate, count, subject|
|
||||
count = count.to_i
|
||||
raise 'Only values between 1 and 3 are allowed for hashes' if count < 1 || count > 3
|
||||
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
|
||||
expectation = negate ? :should_not : :should
|
||||
|
||||
case count
|
||||
when 1
|
||||
send(expectation, have_css('a', text: "##{work_package.id}"))
|
||||
when 2
|
||||
send(expectation, have_css('a', text: "#{work_package.type} ##{work_package.id}".strip))
|
||||
send(expectation, have_text("#{work_package.subject} #{work_package.start_date} – #{work_package.due_date}"))
|
||||
when 3
|
||||
send(expectation, have_css('a', text: "#{work_package.type} ##{work_package.id}".strip))
|
||||
send(expectation, have_text("#{work_package.subject} #{work_package.start_date} – #{work_package.due_date}"))
|
||||
send(expectation, have_css('.quick_info.attributes', text: work_package.assigned_to.name)) if work_package.assigned_to
|
||||
send(expectation, have_css('.quick_info.attributes', text: work_package.responsible.name)) if work_package.responsible
|
||||
send(expectation, have_css('.quick_info.description', text: work_package.description)) if work_package.description
|
||||
end
|
||||
end
|
||||
@@ -1,210 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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 'rack_session_access/capybara'
|
||||
|
||||
InstanceFinder.register(WorkPackage, Proc.new { |name| WorkPackage.find_by(subject: name) })
|
||||
RouteMap.register(WorkPackage, '/work_packages')
|
||||
|
||||
Given /^the work package "(.*?)" has the following children:$/ do |work_package_subject, table|
|
||||
parent = WorkPackage.find_by(subject: work_package_subject)
|
||||
|
||||
table.raw.flatten.each do |child_subject|
|
||||
child = WorkPackage.find_by(subject: child_subject)
|
||||
|
||||
child.parent_id = parent.id
|
||||
|
||||
child.save
|
||||
end
|
||||
end
|
||||
|
||||
Given /^a relation between "(.*?)" and "(.*?)"$/ do |work_package_from, work_package_to|
|
||||
from = WorkPackage.find_by(subject: work_package_from)
|
||||
to = WorkPackage.find_by(subject: work_package_to)
|
||||
|
||||
FactoryBot.create :relation, from: from, to: to
|
||||
end
|
||||
|
||||
Given /^user is already watching "(.*?)"$/ do |work_package_subject|
|
||||
work_package = WorkPackage.find_by(subject: work_package_subject)
|
||||
user = User.find(page.get_rack_session['user_id'])
|
||||
|
||||
work_package.add_watcher user
|
||||
end
|
||||
|
||||
Given(/^the work_package "(.+?)" is updated with the following:$/) do |subject, table|
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
except = {}
|
||||
|
||||
except['type'] = lambda { |wp, value| wp.type = ::Type.find_by(name: value) if value }
|
||||
except['assigned_to'] = lambda { |wp, value| wp.assigned_to = User.find_by_login(value) if value }
|
||||
except['responsible'] = lambda { |wp, value| wp.responsible = User.find_by_login(value) if value }
|
||||
|
||||
send_table_to_object(work_package, table, except)
|
||||
end
|
||||
|
||||
Given(/^the user "([^\"]+)" has the following queries by type in the project "(.*?)":$/) do |login, project_name, table|
|
||||
u = User.find_by login: login
|
||||
p = get_project(project_name)
|
||||
|
||||
table.hashes.each_with_index do |t, _i|
|
||||
types = ::Type.where(name: t['type_value']).map { |type| type.id.to_s }
|
||||
query = p.queries.create(user_id: u.id, name: t['name'])
|
||||
query.filters.clear
|
||||
query.add_filter(:type_id, '=', types)
|
||||
query.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given(/^the user "([^\"]+)" has the following query menu items in the project "(.*?)":$/) do |login, project_name, table|
|
||||
u = User.find_by login: login
|
||||
p = get_project(project_name)
|
||||
|
||||
table.hashes.each_with_index do |t, _i|
|
||||
query = p.queries.find_by name: t['navigatable']
|
||||
MenuItems::QueryMenuItem.create name: t['name'], title: t['title'], navigatable_id: query.id
|
||||
end
|
||||
end
|
||||
|
||||
When /^the work package table has finished loading$/ do
|
||||
message <<-MESSAGE
|
||||
This is a safeguard to ensure that the work package table is loaded before performing actions
|
||||
on UI items that have not been fully loaded.
|
||||
|
||||
It currently assumes that at least one filter is set, without the necessity of the filter being
|
||||
displayed.
|
||||
MESSAGE
|
||||
|
||||
expect(page).to have_selector('.advanced-filters--filter', visible: false), message
|
||||
end
|
||||
|
||||
When /^I fill in the id of work package "(.+?)" into "(.+?)"$/ do |wp_name, field_name|
|
||||
work_package = InstanceFinder.find(WorkPackage, wp_name)
|
||||
|
||||
fill_in(field_name, with: work_package.id)
|
||||
end
|
||||
|
||||
Then /^the "(.+?)" field should contain the id of work package "(.+?)"$/ do |field_name, wp_name|
|
||||
work_package = InstanceFinder.find(WorkPackage, wp_name)
|
||||
|
||||
should have_field(field_name, with: work_package.id.to_s)
|
||||
end
|
||||
|
||||
Then /^the work package "(.+?)" should be shown as the parent$/ do |wp_name|
|
||||
work_package = InstanceFinder.find(WorkPackage, wp_name)
|
||||
|
||||
step "I open the work package tab \"Relations\""
|
||||
within('.tabcontent') do
|
||||
should have_content(work_package.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the work package should be shown with the following values:$/ do |table|
|
||||
table_attributes = table.raw.select { |k, _v|
|
||||
!['Subject', 'Description'].include?(k)
|
||||
}
|
||||
|
||||
table_attributes.each do |key, value|
|
||||
label = find('div.attributes-key-value--key', text: key)
|
||||
should have_css("div.#{label[:class].split(' ').last}", text: value)
|
||||
end
|
||||
|
||||
if table.rows_hash['Subject']
|
||||
subject_field = find(".work-packages--details--subject input")
|
||||
expect(subject_field.value).to eq(table.rows_hash['Subject'])
|
||||
end
|
||||
|
||||
if table.rows_hash['Description']
|
||||
should have_css('.work-packages--details--description', text: table.rows_hash['Description'])
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^the attribute "(.*?)" of work package "(.*?)" should be "(.*?)"$/) do |attribute, wp_name, value|
|
||||
wp = WorkPackage.find_by(subject: wp_name)
|
||||
wp ||= WorkPackages.where('subject like ?', wp_name).to_sql
|
||||
wp.send(attribute).to_s.should == value
|
||||
end
|
||||
|
||||
When /^I open the work package tab "(.+?)"$/ do |tab_label|
|
||||
within('#tabs') do
|
||||
click_link tab_label
|
||||
end
|
||||
end
|
||||
|
||||
When /^I click the edit work package button$/ do
|
||||
within('#toolbar-items') do
|
||||
find('button[title=Edit]').click
|
||||
end
|
||||
end
|
||||
|
||||
When /^I click the watch work package button$/ do
|
||||
within('#toolbar-items') do
|
||||
find('#watch-button').click
|
||||
end
|
||||
end
|
||||
|
||||
When /^I click the unwatch work package button$/ do
|
||||
within('#toolbar-items') do
|
||||
find('#unwatch-button').click
|
||||
end
|
||||
end
|
||||
|
||||
When /^I fill in a comment with "(.+?)"$/ do |comment|
|
||||
# Using the "I click on "..." step does not work for some reason
|
||||
|
||||
find('.work-packages--activity--add-comment .inplace-editing--trigger-link').click
|
||||
|
||||
steps %{
|
||||
Then I fill in "value" with "#{comment}" within ".work-packages--activity--add-comment"
|
||||
}
|
||||
end
|
||||
|
||||
When /^I preview the comment to be added and see "(.+?)"$/ do |comment|
|
||||
steps %{
|
||||
And I click on "Preview" within ".work-packages--activity--add-comment"
|
||||
And I should see "#{comment}" within ".work-packages--activity--add-comment .inplace-edit--preview"
|
||||
}
|
||||
end
|
||||
|
||||
When /^I should see the comment "(.+?)"$/ do |comment|
|
||||
steps %{
|
||||
And I should see "#{comment}" within ".work-package-details-activities-list"
|
||||
}
|
||||
end
|
||||
|
||||
When /^I preview the "(.+?)" and see "(.+?)"$/ do |field_name, text|
|
||||
steps %{
|
||||
And I click on "Preview" within ".work-packages--details--#{field_name}"
|
||||
And I should see "#{text}" within ".work-packages--details--#{field_name} .-preview"
|
||||
}
|
||||
end
|
||||
|
||||
When /^I click to see all work package attributes$/ do
|
||||
find('a', text: I18n.t('js.label_show_attributes')).click
|
||||
end
|
||||
@@ -1,56 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
module Support
|
||||
module Cleanup
|
||||
def self.to_clean(&block)
|
||||
cleanings << block
|
||||
end
|
||||
|
||||
def self.cleanup
|
||||
cleanings.each(&:call)
|
||||
|
||||
reset_cleanings
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.cleanings
|
||||
@cleanings ||= []
|
||||
end
|
||||
|
||||
def self.reset_cleanings
|
||||
@cleanings = []
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
After do
|
||||
Support::Cleanup.cleanup
|
||||
end
|
||||
@@ -1,35 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
module CukeI18n
|
||||
def translate(step)
|
||||
step.gsub(/t:[\w\.]+/) { |code| I18n.t(code.split(':').last) }
|
||||
end
|
||||
end
|
||||
|
||||
World(CukeI18n)
|
||||
@@ -1,150 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
||||
# It is recommended to regenerate this file in the future when you upgrade to a
|
||||
# newer version of cucumber-rails. Consider adding your own code to a new file
|
||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
||||
# files.
|
||||
|
||||
require 'cucumber/rails'
|
||||
require 'cucumber/rspec/doubles'
|
||||
require 'capybara-screenshot/cucumber'
|
||||
require 'factory_bot_rails'
|
||||
|
||||
# Load paths to ensure they are loaded before the plugin's paths.rbs.
|
||||
# Plugin's path_to functions rely on being loaded after the core's path_to
|
||||
# function, since they call super if they don't match and the core doesn't.
|
||||
# So in case a plugin's path_to is loaded first, the core's path_to will
|
||||
# overwrite it when loaded and the plugin's paths are not found.
|
||||
require_relative 'paths.rb'
|
||||
|
||||
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
||||
# order to ease the transition to Capyba we set the default here. If you'd
|
||||
# prefer to use XPath just remove this line and adjust any selectors in your
|
||||
# steps to use the XPath syntax.
|
||||
Capybara.configure do |config|
|
||||
config.default_selector = :css
|
||||
config.default_max_wait_time = 5
|
||||
config.ignore_hidden_elements = true
|
||||
config.match = :one
|
||||
config.visible_text_only = true
|
||||
end
|
||||
|
||||
# Set up S3 uploads if desired
|
||||
if ENV['OPENPROJECT_ENABLE_CAPYBARA_SCREENSHOT_S3_UPLOADS'] && ENV['AWS_ACCESS_KEY_ID']
|
||||
Capybara::Screenshot.s3_configuration = {
|
||||
s3_client_credentials: {
|
||||
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
|
||||
secret_access_key: ENV.fetch('AWS_ACCESS_KEY_SECRET'),
|
||||
region: ENV.fetch('AWS_REGION', 'eu-west-1')
|
||||
},
|
||||
bucket_name: ENV.fetch('S3_BUCKET_NAME', 'openproject-travis-logs')
|
||||
}
|
||||
end
|
||||
|
||||
Capybara.register_server :puma do |app, port, host|
|
||||
require 'rack/handler/puma'
|
||||
Rack::Handler::Puma.run(app, Host: host, Port: port, Threads: "0:1")
|
||||
end
|
||||
Capybara.server = :puma
|
||||
|
||||
unless (env_no = ENV['TEST_ENV_NUMBER'].to_i).zero?
|
||||
Capybara.server_port = 8888 + env_no
|
||||
|
||||
# Give firefox some time to setup / load himself
|
||||
sleep env_no * 5
|
||||
end
|
||||
|
||||
require Rails.root.to_s + '/spec/support/downloaded_file'
|
||||
require Rails.root.to_s + '/spec/support/browsers/chrome'
|
||||
|
||||
Capybara.javascript_driver = :chrome_en
|
||||
|
||||
# By default, any exception happening in your Rails application will bubble up
|
||||
# to Cucumber so that your scenario will fail. This is a different from how
|
||||
# your application behaves in the production environment, where an error page will
|
||||
# be rendered instead.
|
||||
#
|
||||
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
||||
# exceptions and display an error page (just like when the app is running in production).
|
||||
# Typical scenarios where you want to do this is when you test your error pages.
|
||||
# There are two ways to allow Rails to rescue exceptions:
|
||||
#
|
||||
# 1) Tag your scenario (or feature) with @allow-rescue
|
||||
#
|
||||
# 2) Set the value below to true. Beware that doing this globally is not
|
||||
# recommended as it will mask a lot of errors for you!
|
||||
#
|
||||
ActionController::Base.allow_rescue = false
|
||||
|
||||
# Remove/comment out the lines below if your app doesn't have a database.
|
||||
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
||||
begin
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
rescue NameError
|
||||
raise 'You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it.'
|
||||
end
|
||||
|
||||
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
||||
# See the DatabaseCleaner documentation for details. Example:
|
||||
#
|
||||
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
||||
# # { except: [:widgets] } may not do what you expect here
|
||||
# # as tCucumber::Rails::Database.javascript_strategy overrides
|
||||
# # this setting.
|
||||
# DatabaseCleaner.strategy = :truncation
|
||||
# end
|
||||
#
|
||||
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
||||
# DatabaseCleaner.strategy = :transaction
|
||||
# end
|
||||
#
|
||||
|
||||
# Possible values are :truncation and :transaction
|
||||
# The :transaction strategy is faster, but might give you threading problems.
|
||||
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
||||
Cucumber::Rails::Database.javascript_strategy = :truncation
|
||||
|
||||
# Remove any modal dialog remaining from the scenarios which finish in an unclean state
|
||||
Before do |_scenario|
|
||||
page.driver.browser.switch_to.alert.accept rescue Selenium::WebDriver::Error::NoSuchAlertError
|
||||
end
|
||||
|
||||
Before do
|
||||
if Capybara.current_driver == :poltergeist
|
||||
page.driver.headers = { "Accept-Language" => "en" }
|
||||
end
|
||||
end
|
||||
|
||||
Before do
|
||||
FactoryBot.create(:non_member)
|
||||
FactoryBot.create(:anonymous_role)
|
||||
end
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,42 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
module LoginSteps
|
||||
def login(login, password)
|
||||
# visit '/logout' # uncomment me if needed
|
||||
visit '/login'
|
||||
within('#login-form') do
|
||||
fill_in 'username', with: login
|
||||
fill_in 'password', with: password
|
||||
click_button translate('t:button_login')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
World(LoginSteps)
|
||||
@@ -1,428 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# TL;DR: YOU SHOULD DELETE THIS FILE
|
||||
#
|
||||
# This file is used by web_steps.rb, which you should also delete
|
||||
#
|
||||
# You have been warned
|
||||
module NavigationHelpers
|
||||
# Maps a name to a path. Used by the
|
||||
#
|
||||
# When /^I go to (.+)$/ do |page_name|
|
||||
#
|
||||
# step definition in web_steps.rb
|
||||
#
|
||||
def path_to(page_name)
|
||||
case page_name
|
||||
|
||||
when /^the home\s?page$/
|
||||
'/'
|
||||
|
||||
when /^the login page$/
|
||||
'/login'
|
||||
|
||||
when /^the(?: "(.+?)" tab of the)? settings page (?:of|for) the project called "(.+?)"$/
|
||||
tab = $1 || ''
|
||||
project_identifier = $2.gsub("\"", '')
|
||||
tab.gsub("\"", '')
|
||||
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
|
||||
if tab == ''
|
||||
"/projects/#{project_identifier}/settings"
|
||||
else
|
||||
"/projects/#{project_identifier}/settings/#{tab}"
|
||||
end
|
||||
|
||||
when /^the [wW]iki [pP]age "([^\"]+)" (?:for|of) the project called "([^\"]+)"$/
|
||||
wiki_page = $1
|
||||
project_identifier = $2.gsub("\"", '')
|
||||
project = Project.find_by(name: project_identifier)
|
||||
|
||||
wiki_page.gsub!(' ', '%20')
|
||||
project_identifier = project.identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/wiki/#{wiki_page}"
|
||||
|
||||
when /^the lost password page$/
|
||||
'/account/lost_password'
|
||||
|
||||
when /^the groups administration page$/
|
||||
'/admin/groups'
|
||||
|
||||
when /^the admin page of pending users$/
|
||||
'/users?sort=created_on:desc&status=registered'
|
||||
|
||||
when /^the edit menu item page of the [wW]iki [pP]age "([^\"]+)" (?:for|of) the project called "([^\"]+)"$/
|
||||
project_identifier = $2.gsub("\"", '')
|
||||
project = Project.find_by(name: project_identifier)
|
||||
project_identifier = project.identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/wiki/#{$1}/wiki_menu_item/edit"
|
||||
|
||||
when /^the [cC]ost [rR]eports page (?:of|for) the project called "([^\"]+)" without filters or groups$/
|
||||
project_identifier = Project.find_by(name: $1).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/cost_reports?set_filter=1"
|
||||
|
||||
when /^the [cC]ost [rR]eports page (?:of|for) the project called "([^\"]+)"$/
|
||||
project_identifier = Project.find_by(name: $1).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/cost_reports"
|
||||
|
||||
when /^the overall [cC]ost [rR]eports page$/
|
||||
'/cost_reports'
|
||||
|
||||
when /^the overall [cC]ost [rR]eports page without filters or groups$/
|
||||
'/cost_reports?set_filter=1'
|
||||
|
||||
when /^the overall [cC]ost [rR]eports page with standard groups in debug mode$/
|
||||
'/cost_reports?set_filter=1&groups[columns][]=cost_type_id&groups[rows][]=user_id&debug=1'
|
||||
|
||||
when /^the overall [cC]ost [rR]eports page with standard groups$/
|
||||
'/cost_reports?set_filter=1&groups[columns][]=cost_type_id&groups[rows][]=user_id'
|
||||
|
||||
when /^the overall [pP]rojects page$/
|
||||
'/projects'
|
||||
|
||||
when /^the (?:(?:overview |home ?))?page (?:for|of) the project(?: called)? "(.+)"$/
|
||||
project_identifier = $1.gsub("\"", '')
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}"
|
||||
|
||||
when /^the activity page of the project(?: called)? "(.+)"$/
|
||||
project_identifier = $1.gsub("\"", '')
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/activity"
|
||||
|
||||
when /^the overall activity page$/
|
||||
'/activity'
|
||||
|
||||
when /^the page (?:for|of) the issue "([^\"]+)"$/
|
||||
issue = WorkPackage.find_by(subject: $1)
|
||||
"/work_packages/#{issue.id}"
|
||||
|
||||
when /^the edit page (?:for|of) the work package(?: called)? "([^\"]+)"$/
|
||||
issue = WorkPackage.find_by(subject: $1)
|
||||
"/work_packages/#{issue.id}/activity"
|
||||
|
||||
when /^the copy page (?:for|of) the work package "([^\"]+)"$/
|
||||
package = WorkPackage.find_by(subject: $1)
|
||||
project = package.project
|
||||
"/projects/#{project.identifier}/work_packages/new?copy_from=#{package.id}"
|
||||
|
||||
when /^the work packages? index page (?:for|of) (the)? project(?: called)? (.+)$/
|
||||
project_identifier = $2.gsub("\"", '')
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/work_packages"
|
||||
|
||||
when /^the page (?:for|of) the work package(?: called)? "([^\"]+)"$/
|
||||
work_package = WorkPackage.find_by(subject: $1)
|
||||
"/work_packages/#{work_package.id}/activity"
|
||||
|
||||
when /^the page (?:for|of) the work package "([^\"]+)" in project "([^\"]+)"$/
|
||||
work_package = WorkPackage.find_by(subject: $1)
|
||||
project = Project.find_by(identifier: $2)
|
||||
|
||||
"/projects/#{project.identifier}/work_packages/#{work_package.id}/activity"
|
||||
|
||||
when /^the new work_package page (?:for|of) the project called "([^\"]+)"$/
|
||||
"/projects/#{$1}/work_packages/new"
|
||||
|
||||
when /^the bulk destroy page of work packages$/
|
||||
Rails.application.routes.url_helpers.work_packages_bulk_path
|
||||
|
||||
when /^the wiki index page(?: below the (.+) page)? (?:for|of) (?:the)? project(?: called)? (.+)$/
|
||||
parent_page_title = $1
|
||||
project_identifier = $2
|
||||
project_identifier.gsub!("\"", '')
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
|
||||
if parent_page_title.present?
|
||||
parent_page_title.gsub!("\"", '')
|
||||
|
||||
"/projects/#{project_identifier}/wiki/#{parent_page_title}/toc"
|
||||
else
|
||||
"/projects/#{project_identifier}/wiki/index"
|
||||
end
|
||||
|
||||
when /^the wiki new child page below the (.+) page (?:for|of) (?:the)? project(?: called)? (.+)$/
|
||||
parent_page_title = $1
|
||||
project_identifier = $2
|
||||
project_identifier.gsub!("\"", '')
|
||||
parent_page_title.gsub!("\"", '')
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
|
||||
"/projects/#{project_identifier}/wiki/#{parent_page_title}/new"
|
||||
|
||||
when /^the edit page (?:for |of )(the )?role(?: called)? (.+)$/
|
||||
role_identifier = $2.gsub("\"", '')
|
||||
role_identifier = Role.find_by(name: role_identifier).id
|
||||
"admin/roles/#{role_identifier}/edit"
|
||||
|
||||
when /^the new user page$/
|
||||
'/users/new'
|
||||
|
||||
when /^the edit page (?:for |of )(the )?user(?: called)? (.+)$/
|
||||
user_identifier = $2.gsub("\"", '')
|
||||
user_identifier = User.find_by_login(user_identifier).id
|
||||
"/users/#{user_identifier}/edit"
|
||||
|
||||
when /^the (.+) tab of the edit page (?:for |of )(the )?user(?: called)? (.+)$/
|
||||
tab = $1
|
||||
user_identifier = $3.gsub("\"", '')
|
||||
user_identifier = User.find_by_login(user_identifier).id
|
||||
"/users/#{user_identifier}/edit/#{tab}"
|
||||
|
||||
when /^the show page (?:for |of )(the )?user(?: called)? (.+)$/
|
||||
user_identifier = $2.gsub("\"", '')
|
||||
user_identifier = User.find_by_login(user_identifier).id
|
||||
"/users/#{user_identifier}"
|
||||
|
||||
when /^the index page (?:for|of) users$/
|
||||
'/users'
|
||||
|
||||
when /^the members page of the project(?: called)? (.+)$/
|
||||
project_identifier = $1.gsub("\"", '')
|
||||
"/projects/#{project_identifier}/members"
|
||||
|
||||
when /^the new member page of the project(?: called)? (.+)$/
|
||||
project_identifier = $1.gsub("\"", '')
|
||||
"/projects/#{project_identifier}/members/new"
|
||||
|
||||
when /^the global index page (?:for|of) (.+)$/
|
||||
"/#{$1.gsub(' ', '_')}"
|
||||
|
||||
when /^the edit page (?:for |of )the version(?: called) (.+)$/
|
||||
version_name = $1.gsub("\"", '')
|
||||
version = Version.find_by(name: version_name)
|
||||
"/versions/#{version.id}/edit"
|
||||
|
||||
# this should be handled by the generic "the edit page of ..." path
|
||||
# but the path required differs from the standard
|
||||
# delete once the path is corrected
|
||||
when /the edit page (?:for |of )the (?:issue )?custom field(?: called) (.+)/
|
||||
name = $1.gsub("\"", '')
|
||||
instance = InstanceFinder.find(CustomField, name)
|
||||
"/custom_fields/edit/#{instance.id}"
|
||||
|
||||
when /^the new page (?:for|of) (.+)$/
|
||||
model = $1.gsub!("\"", '').downcase
|
||||
"/#{model.pluralize}/new"
|
||||
|
||||
when /^the edit page of the group called "([^\"]+)"$/
|
||||
identifier = $1.gsub("\"", '')
|
||||
instance = InstanceFinder.find(Group, identifier)
|
||||
"/admin/groups/#{instance.id}/edit"
|
||||
|
||||
when /^the edit page (?:for|of) (?:the )?([^\"]+?)(?: called)? "([^\"]+)"$/
|
||||
model = $1
|
||||
identifier = $2
|
||||
identifier.gsub!("\"", '')
|
||||
model = model.gsub("\"", '').gsub(/\s/, '_')
|
||||
|
||||
begin
|
||||
instance = InstanceFinder.find(model.camelize.constantize, identifier)
|
||||
rescue NameError
|
||||
instance = InstanceFinder.find(model.to_sym, identifier)
|
||||
end
|
||||
|
||||
root = RouteMap.route(instance.class)
|
||||
|
||||
"#{root}/#{instance.id}/edit"
|
||||
|
||||
when /^the log ?out page$/
|
||||
'/logout'
|
||||
|
||||
when /^the (register|registration) page$/
|
||||
'/account/register'
|
||||
|
||||
when /^the activate registration page for the user called (.+) with (.+)$/
|
||||
name = $1.dup
|
||||
selection = $2.dup
|
||||
name.gsub!("\"", '')
|
||||
selection.gsub!("\"", '')
|
||||
u = User.find_by_login(name)
|
||||
"/account/#{u.id}/activate?#{selection}"
|
||||
|
||||
when /^the My page$/
|
||||
'/my/page'
|
||||
|
||||
when /^the My page personalization page$/
|
||||
'/my/page_layout'
|
||||
|
||||
when /^the [mM]y account page$/
|
||||
'/my/account'
|
||||
|
||||
when /^the [aA]ccess [tT]oken page$/
|
||||
'/my/access_token'
|
||||
|
||||
when /^the my [sS]ettings page$/
|
||||
'/my/settings'
|
||||
|
||||
when /^the (administration|admin) page$/
|
||||
'/admin'
|
||||
|
||||
when /^the(?: (.+?) tab of the)? settings page$/
|
||||
if $1.nil?
|
||||
'/settings'
|
||||
else
|
||||
"/settings/edit?tab=#{$1}"
|
||||
end
|
||||
|
||||
when /^the(?: (.+?) tab of the)? settings page (?:of|for) the project "(.+?)"$/
|
||||
if $1.nil?
|
||||
"/projects/#{$2}/settings"
|
||||
else
|
||||
"/projects/#{$2}/settings/#{$1}"
|
||||
end
|
||||
|
||||
when /^the edit page of Announcement$/
|
||||
'/announcements/1/edit'
|
||||
|
||||
when /^the index page of Roles$/
|
||||
'/admin/roles'
|
||||
|
||||
when /^the search page$/
|
||||
'/search'
|
||||
|
||||
when /^the custom fields page$/
|
||||
'/custom_fields'
|
||||
|
||||
when /^the enumerations page$/
|
||||
'/admin/enumerations'
|
||||
|
||||
when /^the authentication modes page$/
|
||||
'/admin/auth_sources'
|
||||
|
||||
when /the page of the timeline(?: "([^\"]+)")? of the project called "([^\"]+)"$/
|
||||
timeline_name = $1
|
||||
project_name = $2
|
||||
project = Project.find_by(name: project_name)
|
||||
project_identifier = project.identifier.gsub(' ', '%20')
|
||||
timeline = project.timelines.detect { |t| t.name == timeline_name }
|
||||
|
||||
timeline_id = timeline ? "/#{timeline.id}" : ''
|
||||
|
||||
"/projects/#{project_identifier}/timelines#{timeline_id}"
|
||||
|
||||
when /the new timeline page of the project called "([^\"]+)"$/
|
||||
project_name = $1
|
||||
project_identifier = Project.find_by(name: project_name).identifier.gsub(' ', '%20')
|
||||
|
||||
"/projects/#{project_identifier}/timelines/new"
|
||||
|
||||
when /the edit page of the timeline "([^\"]+)" of the project called "([^\"]+)"$/
|
||||
timeline_name = $1
|
||||
project_name = $2
|
||||
project_identifier = Project.find_by(name: project_name).identifier.gsub(' ', '%20')
|
||||
timeline = Timeline.find_by(name: timeline_name)
|
||||
"/projects/#{project_identifier}/timelines/#{timeline.id}/edit"
|
||||
|
||||
when /^the page of the planning element "([^\"]+)" of the project called "([^\"]+)"$/
|
||||
planning_element_name = $1
|
||||
planning_element = WorkPackage.find_by(subject: planning_element_name)
|
||||
"/work_packages/#{planning_element.id}"
|
||||
|
||||
when /^the (.+) page (?:for|of) the project called "([^\"]+)"$/
|
||||
project_page = $1
|
||||
project_identifier = $2.gsub("\"", '')
|
||||
project_page = project_page.gsub(' ', '').underscore
|
||||
project_identifier = Project.find_by(name: project_identifier).identifier.gsub(' ', '%20')
|
||||
"/projects/#{project_identifier}/#{project_page}"
|
||||
|
||||
when /the reportings of the project called "([^\"]+)"$/
|
||||
project_name = $1
|
||||
project = Project.find_by(name: project_name)
|
||||
project_identifier = project.identifier.gsub(' ', '%20')
|
||||
|
||||
"/projects/#{project_identifier}/reportings"
|
||||
|
||||
when /^the quick reference for wiki syntax$/
|
||||
'/help/wiki_syntax'
|
||||
|
||||
when /^the detailed wiki syntax help page$/
|
||||
'/help/wiki_syntax_detailed'
|
||||
|
||||
when /^the configuration page of the "(.+)" plugin$/
|
||||
"/settings/plugin/#{$1}"
|
||||
|
||||
when /^the admin page of the group called "([^"]*)"$/
|
||||
id = Group.find_by!(lastname: $1).id
|
||||
"/admin/groups/#{id}/edit"
|
||||
|
||||
when /^the time entry page of issue "(.+)"$/
|
||||
issue_id = WorkPackage.find_by(subject: $1).id
|
||||
"/work_packages/#{issue_id}/time_entries"
|
||||
|
||||
when /^the time entry report page of issue "(.+)"$/
|
||||
issue_id = WorkPackage.find_by(subject: $1).id
|
||||
"/work_packages/#{issue_id}/time_entries/report"
|
||||
|
||||
when /^the move new page of the work package "(.+)"$/
|
||||
work_package_id = WorkPackage.find_by(subject: $1).id
|
||||
"/work_packages/#{work_package_id}/move/new?copy="
|
||||
|
||||
when /^the applied query "([^\"]+)" on the work packages index page of the project "([^\"]+)"$/
|
||||
project = Project.find_by(name: $2)
|
||||
query = project.queries.find_by(name: $1)
|
||||
project_work_packages_path project, query_id: query.id
|
||||
|
||||
when /^the move page of the work package "(.+)"$/
|
||||
work_package_id = WorkPackage.find_by(subject: $1).id
|
||||
"/work_packages/#{work_package_id}/move/new"
|
||||
|
||||
when /^the message page of message "(.+)"$/
|
||||
message = Message.find_by(subject: $1)
|
||||
topic_path(message)
|
||||
|
||||
when /^the show page (for|of) version ('|")(.+)('|")$/
|
||||
version = Version.find_by(name: $3)
|
||||
version_path(version)
|
||||
|
||||
when /^the edit page (for|of) version ('|")(.+)('|")$/
|
||||
version = Version.find_by(name: $3)
|
||||
edit_version_path(version)
|
||||
|
||||
# Add more mappings here.
|
||||
# Here is an example that pulls values out of the Regexp:
|
||||
#
|
||||
# when /^(.*)'s profile page$/i
|
||||
# user_profile_path(User.find_by_login($1))
|
||||
else
|
||||
begin
|
||||
page_name =~ /^the (.*) page$/
|
||||
path_components = $1.split(/\s+/)
|
||||
send(path_components.push('path').join('_').to_sym)
|
||||
rescue NoMethodError, ArgumentError
|
||||
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
||||
"Now, go and add a mapping in #{__FILE__}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
World(NavigationHelpers)
|
||||
@@ -1,42 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
class RouteMap
|
||||
def self.register(model, route)
|
||||
@map ||= {}
|
||||
|
||||
@map[model] = route
|
||||
end
|
||||
|
||||
def self.route(model)
|
||||
@map ||= {}
|
||||
|
||||
@map[model] || "/#{model.to_s.underscore.pluralize}"
|
||||
end
|
||||
end
|
||||
@@ -1,77 +0,0 @@
|
||||
#-- encoding: UTF-8
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# TL;DR: YOU SHOULD DELETE THIS FILE
|
||||
#
|
||||
# This file is used by web_steps.rb, which you should also delete
|
||||
#
|
||||
# You have been warned
|
||||
module HtmlSelectorsHelpers
|
||||
# Maps a name to a selector. Used primarily by the
|
||||
#
|
||||
# When /^(.+) within (.+)$/ do |step, scope|
|
||||
#
|
||||
# step definitions in web_steps.rb
|
||||
#
|
||||
def selector_for(locator)
|
||||
case locator
|
||||
|
||||
when 'the page'
|
||||
'html > body'
|
||||
|
||||
# Add more mappings here.
|
||||
# Here is an example that pulls values out of the Regexp:
|
||||
#
|
||||
# when /^the (notice|error|info) flash$/
|
||||
# ".flash.#{$1}"
|
||||
|
||||
# You can also return an array to use a different selector
|
||||
# type, like:
|
||||
#
|
||||
# when /the header/
|
||||
# [:xpath, "//header"]
|
||||
|
||||
# This allows you to provide a quoted selector as the scope
|
||||
# for "within" steps as was previously the default for the
|
||||
# web steps:
|
||||
when /^"(.+)"$/
|
||||
$1
|
||||
# added second when case as changing the above regexp to
|
||||
# /^"?(.+)"?$/ did not work for some reason
|
||||
when /^(.+)$/
|
||||
$1
|
||||
|
||||
else
|
||||
raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
|
||||
"Now, go and add a mapping in #{__FILE__}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
World(HtmlSelectorsHelpers)
|
||||
@@ -34,12 +34,6 @@ module Plugins
|
||||
}.keep_if{ |path| File.directory?(path) }
|
||||
end
|
||||
|
||||
def self.cucumber_load_paths
|
||||
plugin_load_paths.map { |path|
|
||||
File.join(path, 'features')
|
||||
}.keep_if{ |path| File.directory?(path) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# fetch load paths for available plugins
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
class ScenarioDisabler
|
||||
def self.empty_if_disabled(scenario)
|
||||
if self.disabled?(scenario)
|
||||
scenario.skip_invoke!
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def self.disable(options)
|
||||
@disabled_scenarios ||= []
|
||||
|
||||
@disabled_scenarios << options
|
||||
end
|
||||
|
||||
def self.disabled?(scenario)
|
||||
# we have to check whether the scenario actually has a feature because there can also be scenario outlines
|
||||
# as described in https://github.com/cucumber/cucumber/wiki/Scenario-Outlines and the variables definition is
|
||||
# also matched as a scenario
|
||||
@disabled_scenarios.present? && scenario.respond_to?(:feature) && @disabled_scenarios.any? do |disabled_scenario|
|
||||
disabled_scenario[:feature] == scenario.feature.name && disabled_scenario[:scenario] == scenario.name
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,123 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
||||
# It is recommended to regenerate this file in the future when you upgrade to a
|
||||
# newer version of cucumber-rails. Consider adding your own code to a new file
|
||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
||||
# files.
|
||||
|
||||
unless ARGV.any? { |a| a =~ /\Agems/ } # Don't load anything when running the gems:* tasks
|
||||
|
||||
begin
|
||||
require 'shellwords'
|
||||
require 'cucumber'
|
||||
require 'cucumber/rake/task'
|
||||
|
||||
namespace :cucumber do
|
||||
Cucumber::Rake::Task.new({ ok: ['db:test:prepare'] }, 'Run features that should pass') do |t|
|
||||
t.fork = true # You may get faster startup if you set this to false
|
||||
end
|
||||
|
||||
task :statsetup do
|
||||
require 'rails/code_statistics'
|
||||
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
||||
::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
|
||||
end
|
||||
|
||||
def define_cucumber_task(name, description, arguments = [])
|
||||
desc description
|
||||
# task name, arguments => ['db:test:prepare', 'assets:prepare_op'] do |_t, args|
|
||||
task name, arguments => ['db:test:prepare'] do |_t, args|
|
||||
if name == :custom
|
||||
if not args[:features]
|
||||
raise 'Please provide :features argument, e.g. rake cucumber:custom[features/my_feature.feature]'
|
||||
end
|
||||
features = args[:features].split(/\s+/)
|
||||
else
|
||||
features = Plugins::LoadPathHelper.cucumber_load_paths
|
||||
|
||||
if name == :plugins
|
||||
# in case we want to run cucumber plugins and there are none
|
||||
# we exit with positive message
|
||||
if features.empty?
|
||||
puts
|
||||
puts '##### There are no cucumber features for OpenProject plugins to be run.'
|
||||
puts
|
||||
exit(0)
|
||||
end
|
||||
end
|
||||
|
||||
if name == :all
|
||||
features << File.join(Rails.root, 'features')
|
||||
end
|
||||
end
|
||||
|
||||
Cucumber::Rake::Task.new({ cucumber_run: ['db:test:prepare'] }, 'Run features that should pass') do |t|
|
||||
opts = (ENV['CUCUMBER_OPTS'] ? ENV['CUCUMBER_OPTS'].split(/\s+/) : [])
|
||||
ENV.delete('CUCUMBER_OPTS')
|
||||
opts += args[:options].split(/\s+/) if args[:options]
|
||||
|
||||
support_files = [Rails.root.join('features').to_s] + Plugins::LoadPathHelper.cucumber_load_paths
|
||||
support_files = support_files.map { |path|
|
||||
['-r', Shellwords.escape(path)]
|
||||
}.flatten
|
||||
|
||||
t.cucumber_opts = opts + support_files + features
|
||||
|
||||
# If we are not in the test environment, the test gems are not loaded
|
||||
# by Bundler.require in application.rb, so we need to fork.
|
||||
t.fork = Rails.env != 'test'
|
||||
end
|
||||
Rake::Task['cucumber_run'].invoke
|
||||
end
|
||||
end
|
||||
|
||||
define_cucumber_task(:plugins, 'Run plugin features', [:options])
|
||||
define_cucumber_task(:all, 'Run core and plugin features', [:options])
|
||||
define_cucumber_task(:custom, 'Run features selected via features argument', [:features])
|
||||
end
|
||||
|
||||
desc 'Alias for cucumber:ok'
|
||||
task cucumber: 'cucumber:ok'
|
||||
|
||||
task default: :cucumber
|
||||
|
||||
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
||||
task 'db:test:prepare' do
|
||||
end
|
||||
|
||||
task stats: 'cucumber:statsetup'
|
||||
rescue LoadError
|
||||
desc 'cucumber rake task not available (cucumber not installed)'
|
||||
task :cucumber do
|
||||
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -30,8 +30,13 @@
|
||||
require 'optparse'
|
||||
require 'plugins/load_path_helper'
|
||||
|
||||
|
||||
require 'parallel_tests/tasks'
|
||||
# Remove task added by parallel_tests as it conflicts with our own.
|
||||
# Having both will lead to both being executred.
|
||||
Rake::Task["parallel:features"].clear if Rake::Task.task_defined?("parallel:features")
|
||||
|
||||
def check_for_pending_migrations
|
||||
require 'parallel_tests/tasks'
|
||||
ParallelTests::Tasks.check_for_pending_migrations
|
||||
end
|
||||
|
||||
@@ -89,32 +94,16 @@ namespace :parallel do
|
||||
sh "bundle exec parallel_test --type rspec #{group_options} #{folders} #{pattern}"
|
||||
end
|
||||
|
||||
def run_cukes(parsed_options, folders)
|
||||
exit 'No feature folders to run cucumber on' if folders.blank?
|
||||
|
||||
group_options = group_option_string(parsed_options)
|
||||
|
||||
support_files = ([Rails.root.join('features').to_s] + Plugins::LoadPathHelper.cucumber_load_paths)
|
||||
.map { |path| ['-r', Shellwords.escape(path)] }.flatten.join(' ')
|
||||
|
||||
cucumber_options = "-o ' -p rerun #{support_files}'"
|
||||
|
||||
sh "bundle exec parallel_test --type cucumber #{cucumber_options} #{group_options} #{folders}"
|
||||
end
|
||||
|
||||
desc 'Run all suites in parallel (one after another)'
|
||||
task all: ['parallel:plugins:specs',
|
||||
'parallel:plugins:features',
|
||||
'parallel:plugins:cucumber',
|
||||
:spec_legacy,
|
||||
:rspec,
|
||||
:cucumber]
|
||||
:rspec]
|
||||
|
||||
namespace :plugins do
|
||||
desc 'Run all plugin tests in parallel'
|
||||
task all: ['parallel:plugins:specs',
|
||||
'parallel:plugins:features',
|
||||
'parallel:plugins:cucumber']
|
||||
'parallel:plugins:features']
|
||||
|
||||
desc 'Run plugin specs in parallel'
|
||||
task specs: [:environment] do
|
||||
@@ -146,17 +135,6 @@ namespace :parallel do
|
||||
run_specs options, plugin_spec_paths, pattern
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run plugin cucumber features in parallel'
|
||||
task cucumber: [:environment] do
|
||||
ParallelParser.with_args(ARGV) do |options|
|
||||
ARGV.each { |a| task(a.to_sym) {} }
|
||||
|
||||
feature_folders = Plugins::LoadPathHelper.cucumber_load_paths.join(' ')
|
||||
|
||||
run_cukes(options, feature_folders)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc 'Run legacy specs in parallel'
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace :test do
|
||||
desc 'runs all tests'
|
||||
namespace :suite do
|
||||
task run: [:cucumber, :spec, 'spec:legacy']
|
||||
task run: [:spec, 'spec:legacy']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
<%
|
||||
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
||||
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
||||
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
||||
%>
|
||||
default: <%= std_opts %> features -r <%= "#{ENV['RAILS_ROOT']}/features" %> -r features --guess
|
||||
wip: --tags @wip:3 --wip features -r <%= "#{ENV['RAILS_ROOT']}/features" %> -r features --guess
|
||||
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
||||
@@ -1,287 +0,0 @@
|
||||
<!---- copyright
|
||||
OpenProject Backlogs Plugin
|
||||
|
||||
Copyright (C)2013-2014 the OpenProject Foundation (OPF)
|
||||
Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
|
||||
Copyright (C)2010-2011 friflaj
|
||||
Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
|
||||
Copyright (C)2009-2010 Mark Maglana
|
||||
Copyright (C)2009 Joe Heck, Nate Lowrie
|
||||
|
||||
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 Backlogs is a derivative work based on ChiliProject Backlogs.
|
||||
The copyright follows:
|
||||
Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
|
||||
Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
|
||||
|
||||
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.
|
||||
|
||||
++-->
|
||||
|
||||
# Changelog
|
||||
|
||||
* `#10848` Duplicated status select on type switch
|
||||
|
||||
## 3.0.7
|
||||
|
||||
* new version scheme
|
||||
* `#7782` Long target version names destroy layout
|
||||
* `#10228` Font size in backlog and taskboard to small
|
||||
* `#10232` Work package filter introduced by plugins not displayed
|
||||
|
||||
## 3.0.7
|
||||
|
||||
* `#8413` Collapse/Expand arrow not displayed
|
||||
|
||||
## 3.0.6
|
||||
|
||||
* `#5357` Adapt released plugins to base on plugins functionality
|
||||
* Migration fix: Also used plugin_redmine_backlogs as old setting name when migrating
|
||||
|
||||
## 3.0.5
|
||||
|
||||
* `#542` Fix: Deleting the sprint dates still allows to create burndown charts that wont show
|
||||
* `#2526` Fix: Burndown chart for future versions not working
|
||||
* `#3440` New workpackage form layout
|
||||
* `#4118` [FIX] Add missing labels
|
||||
* `#4152` Page not found when only one export card configuration is specified
|
||||
* `#4223` Fix: Taskboard is translated to "Aufgabenliste" in German
|
||||
* `#4224` "Create stories" is translated to "Sprints anlegen" in Roles & Permissions
|
||||
* `#4821` Edit sprint from menu
|
||||
* `#4862` Fix: Internal error with custom field for projects
|
||||
* show description on pdf export modal
|
||||
|
||||
## 3.0.5.pre3
|
||||
|
||||
* `#2259` [Accessibility] linearisation of issue show form (2)
|
||||
* `#3546` Better icon for Timelines Module
|
||||
* use pdf export plugin to export story cards
|
||||
|
||||
## 3.0.5.pre2
|
||||
|
||||
* `#2167` [Accessibility] Link form elements to their label - backlogs - new task
|
||||
* `#2229` [Accessibility] low contrast in backlogs task view
|
||||
* `#2258` [Accessibility] linearisation of issue show form
|
||||
* `#2607` [Agile] Display Storypoints in Taskboard view
|
||||
* `#3532` Fix: [API] It is possible to set statuses that are not allowed by the workflow
|
||||
* `#3649` A backlog item should get the highest position when moved to another backlog
|
||||
|
||||
## 3.0.5.pre1
|
||||
|
||||
* `#2395` [Work Package Tracking] Internal Error when entering a character in a number field in a filter
|
||||
* `#3339` [Agile] Display work package numbers with 7 digits in backlog view
|
||||
* Adaptations for new icon font
|
||||
* Fix: Backlog data existence check
|
||||
|
||||
## 3.0.4
|
||||
|
||||
* `#2728` Prepared public release
|
||||
* updated dependency to OpenProject core
|
||||
* list story_points in the api/v1 if we have them
|
||||
* added icon for new project menu
|
||||
|
||||
## 3.0.4.pre10
|
||||
|
||||
* Fixed missing migration of setting values
|
||||
|
||||
## 3.0.4.pre9
|
||||
|
||||
* `#2545` Migrated old plugin settings
|
||||
* `#2461` Fixed saving of setting for version fold status
|
||||
* `#2413` Squashed old migrations
|
||||
|
||||
## 3.0.4.pre8
|
||||
|
||||
* `#2274` Add foldable versions
|
||||
|
||||
## 3.0.4.pre7
|
||||
|
||||
* `#1093` Fix missing permission translations
|
||||
* `#2070` Adapted to changed core asset locations
|
||||
* fixed specs and cukes
|
||||
* fixed taskboard javascript bug
|
||||
* Rename Issue to WorkPackage
|
||||
|
||||
## 3.0.4.pre6
|
||||
|
||||
* `#2039` Adapt to OpenProject core changes
|
||||
** Renamed Issue 2 WorkPackage
|
||||
** Renamed IssueStatus 2 Status
|
||||
** Renamed Tracker 2 Type
|
||||
** Adaptions for group assigned work packages
|
||||
** Adaptions for new journal handling
|
||||
|
||||
## 3.0.4.pre5 - 2013-07-11
|
||||
|
||||
* Adapt to OpenProject core changes
|
||||
|
||||
## 3.0.4.pre4 - 2013-06-21
|
||||
|
||||
* Adapt to OpenProject core changes
|
||||
|
||||
## 3.0.4.pre3 - 2013-06-21
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Use final plugin name schema
|
||||
|
||||
## 3.0.4.pre2 - 2013-06-14
|
||||
|
||||
### Minor Change
|
||||
|
||||
* added dependency to OpenProject core >= 3.0.0beta1
|
||||
* more robust tests by dropping IE7 workaround
|
||||
|
||||
## 3.0.4.beta - 2013-05-31
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Fixed Translation bugs
|
||||
* Fixed task color setting
|
||||
* Fixed sprint date validation
|
||||
|
||||
## 3.0.3.rc1 - 2013-05-24
|
||||
|
||||
### Major Change
|
||||
|
||||
* RC1 of the Rails 3 version
|
||||
* This version is no longer compatible with the Rails 2 core
|
||||
|
||||
## 2.1.0 - 2012-04-13
|
||||
|
||||
### Major Change
|
||||
|
||||
* Fixing mass assignment vulnerabilities
|
||||
|
||||
## 2.0.4 - 2012-04-03
|
||||
|
||||
### Minor Change
|
||||
|
||||
* fix acts_as_journalized issues
|
||||
* fix showing multiple status in backlogs view
|
||||
|
||||
## 2.0.3 - 2012-03-14
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Fixing typo
|
||||
|
||||
|
||||
## 2.0.2 - 2012-03-12
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Design fixes
|
||||
|
||||
## 2.0.1 - 2012-03-02
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Design fixes
|
||||
|
||||
## 2.0.0 - 2012-02-16
|
||||
|
||||
Incompatible with older versions of ChiliProject
|
||||
|
||||
### Major Change
|
||||
|
||||
* Adds support for breadcrumb navigation within OpenProject
|
||||
|
||||
## 1.2.7 - 2012-02-13
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Design fix
|
||||
|
||||
## 1.2.6 - 2012-02-02
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Supporting changes in accessibility master
|
||||
** Sub issues are now rendered differently and therefor the link has changed
|
||||
|
||||
## 1.2.5 - 2012-01-30
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Removing BETA
|
||||
* Removing font-size definitions to let the global ones kick in
|
||||
|
||||
## 1.2.4 - 2012-01-25
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Improved accessibility of issue box's issue hierarchy view
|
||||
|
||||
## 1.2.3 - 2012-01-20
|
||||
|
||||
### Minor Test Change
|
||||
|
||||
* Moving cucumber step definitions to chiliproject cucumber to use them in other plugins as well.
|
||||
|
||||
## 1.2.2 - 2012-01-16
|
||||
|
||||
### Minor Test Change
|
||||
|
||||
* Moving cucumber step definitions to chiliproject cucumber to use them in other plugins as well.
|
||||
|
||||
## 1.2.1 - 2012-01-05
|
||||
|
||||
### Minor Change
|
||||
|
||||
* Adding missing space on version setting page to fix test and design
|
||||
|
||||
## 1.2.0 - 2012-01-02
|
||||
|
||||
### Minor Changes
|
||||
|
||||
* Improved Ruby 1.9 support
|
||||
* Improved support for the proposed fix of Chili #780
|
||||
* Moved from symbol keys to string keys for plugin settings
|
||||
|
||||
## 1.1.0 - 2011-12-16
|
||||
|
||||
### Minor Changes
|
||||
|
||||
* Tested with the new layout of yet to be released ChiliProject 3.0
|
||||
* Loading jQuery only if ChiliProject doesn't
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixing syntactic ambiguity in Ruby 1.9 (#1)
|
||||
|
||||
## 1.0.2 - 2011-11-21
|
||||
|
||||
### Minor Changes
|
||||
|
||||
* Removing unneccesary migrations
|
||||
* Added information about the needed core patch
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* Fixing tests on Postgres
|
||||
|
||||
## 1.0.1 - 2011-11-16
|
||||
|
||||
### Minor Changes
|
||||
|
||||
* Adding links to ChiliProject Plugin configuration.
|
||||
* Requiring released version od ChiliProject NIssue Plugin
|
||||
|
||||
## 1.0.0 - 2011-11-16 - Initial Release
|
||||
@@ -1,51 +0,0 @@
|
||||
OpenProject Backlogs Plugin
|
||||
|
||||
This Plugin adds features, that enable agile teams to work efficiently with
|
||||
OpenProject in Scrum projects.
|
||||
|
||||
Copyright (C)2013-2014 the OpenProject Foundation (OPF)
|
||||
Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
|
||||
Copyright (C)2010-2011 friflaj
|
||||
Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
|
||||
Copyright (C)2009-2010 Mark Maglana
|
||||
Copyright (C)2009 Joe Heck, Nate Lowrie
|
||||
|
||||
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.
|
||||
|
||||
--
|
||||
|
||||
OpenProject Backlogs is a derivative work based on ChiliProject Backlogs, whose Copyright follows.
|
||||
|
||||
ChiliProject Backlogs Plugin
|
||||
|
||||
This Plugin adds features, that enable agile teams to work efficiently with
|
||||
ChiliProject in Scrum projects.
|
||||
|
||||
|
||||
Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
|
||||
Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
|
||||
|
||||
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.
|
||||
@@ -1,32 +0,0 @@
|
||||
OpenProject Backlogs Plugin
|
||||
|
||||
Copyright (C)2013-2014 the OpenProject Foundation (OPF)
|
||||
Copyright (C)2011 Stephan Eckardt, Tim Felgentreff, Marnen Laibow-Koser, Sandro Munda
|
||||
Copyright (C)2010-2011 friflaj
|
||||
Copyright (C)2010 Maxime Guilbot, Andrew Vit, Joakim Kolsjö, ibussieres, Daniel Passos, Jason Vasquez, jpic, Emiliano Heyns
|
||||
Copyright (C)2009-2010 Mark Maglana
|
||||
Copyright (C)2009 Joe Heck, Nate Lowrie
|
||||
|
||||
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 Backlogs is a derivative work based on ChiliProject Backlogs.
|
||||
The copyright follows:
|
||||
Copyright (C) 2010-2011 - Emiliano Heyns, Mark Maglana, friflaj
|
||||
Copyright (C) 2011 - Jens Ulferts, Gregor Schmidt - Finn GmbH - Berlin, Germany
|
||||
|
||||
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.
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,364 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Given /^I am logged out$/ do
|
||||
logout
|
||||
end
|
||||
|
||||
Given /^I set the (.+) of the story to (.+)$/ do |attribute, value|
|
||||
if attribute == 'type'
|
||||
attribute = 'type_id'
|
||||
value = Type.find_by(name: value).id
|
||||
elsif attribute == 'status'
|
||||
attribute = 'status_id'
|
||||
value = Status.find_by(name: value).id
|
||||
elsif %w[backlog sprint].include? attribute
|
||||
attribute = 'version_id'
|
||||
value = Version.find_by(name: value).id
|
||||
end
|
||||
@story_params[attribute] = value
|
||||
end
|
||||
|
||||
Given /^I set the (.+) of the task to (.+)$/ do |attribute, value|
|
||||
value = '' if value == 'an empty string'
|
||||
@task_params[attribute] = value
|
||||
end
|
||||
|
||||
Given /^I want to create a story(?: in [pP]roject "(.+?)")?$/ do |project_name|
|
||||
project = get_project(project_name)
|
||||
@story_params = initialize_story_params(project)
|
||||
end
|
||||
|
||||
Given /^I want to create a task for (.+)(?: in [pP]roject "(.+?)")?$/ do |story_subject, project_name|
|
||||
project = get_project(project_name)
|
||||
|
||||
story = Story.find_by(subject: story_subject)
|
||||
@task_params = initialize_task_params(project, story)
|
||||
end
|
||||
|
||||
Given /^I want to create an impediment for (.+?)(?: in [pP]roject "(.+?)")?$/ do |sprint_subject, project_name|
|
||||
project = get_project(project_name)
|
||||
sprint = Sprint.find_by(name: sprint_subject)
|
||||
@impediment_params = initialize_impediment_params(project, sprint.id)
|
||||
end
|
||||
|
||||
Given /^I want to edit the task named (.+)$/ do |task_subject|
|
||||
task = Task.find_by(subject: task_subject)
|
||||
task.should_not be_nil
|
||||
@task_params = HashWithIndifferentAccess.new(task.attributes)
|
||||
@task_params['parent_id'] = task.parent_id
|
||||
@task_params
|
||||
end
|
||||
|
||||
Given /^I want to edit the impediment named (.+)$/ do |impediment_subject|
|
||||
impediment = Task.find_by(subject: impediment_subject)
|
||||
impediment.should_not be_nil
|
||||
@impediment_params = HashWithIndifferentAccess.new(impediment.attributes)
|
||||
end
|
||||
|
||||
Given /^I want to edit the sprint named (.+)$/ do |name|
|
||||
sprint = Sprint.find_by(name: name)
|
||||
sprint.should_not be_nil
|
||||
@sprint_params = HashWithIndifferentAccess.new(sprint.attributes)
|
||||
end
|
||||
|
||||
Given /^I want to indicate that the impediment blocks (.+)$/ do |blocks_csv|
|
||||
blocks_csv = Story.where(subject: blocks_csv.split(', ')).pluck(:id).join(',')
|
||||
@impediment_params[:blocks] = blocks_csv
|
||||
end
|
||||
|
||||
Given /^I want to set the (.+) of the sprint to (.+)$/ do |attribute, value|
|
||||
value = '' if value == 'an empty string'
|
||||
@sprint_params[attribute] = value
|
||||
end
|
||||
|
||||
Given /^I want to set the (.+) of the impediment to (.+)$/ do |attribute, value|
|
||||
value = '' if value == 'an empty string'
|
||||
@impediment_params[attribute] = value
|
||||
end
|
||||
|
||||
Given /^I want to edit the story with subject (.+)$/ do |subject|
|
||||
@story = Story.find_by(subject: subject)
|
||||
@story.should_not be_nil
|
||||
@story_params = HashWithIndifferentAccess.new(@story.attributes)
|
||||
end
|
||||
|
||||
Given /^the backlogs module is initialized(?: in [pP]roject "(.*)")?$/ do |project_name|
|
||||
project = get_project(project_name)
|
||||
|
||||
step 'the following types are configured to track stories:', table(%{
|
||||
| Story |
|
||||
| Epic |
|
||||
})
|
||||
step 'the type "Task" is configured to track tasks'
|
||||
step "the project \"#{project.name}\" uses the following types:", table(%{
|
||||
| Story |
|
||||
| Task |
|
||||
})
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following sprints:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
table.hashes.each do |version|
|
||||
['effective_date', 'start_date'].each do |date_attr|
|
||||
version[date_attr] = eval(version[date_attr]).strftime('%Y-%m-%d') if version[date_attr].match(/^(\d+)\.(year|month|week|day|hour|minute|second)(s?)\.(ago|from_now)$/)
|
||||
end
|
||||
sprint = Sprint.new version
|
||||
sprint.project = project
|
||||
sprint.save!
|
||||
|
||||
vs = sprint.version_settings.build
|
||||
vs.project = project
|
||||
vs.display_left!
|
||||
vs.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following (?:product )?(?:owner )?backlogs?:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
table.raw.each do |row|
|
||||
version = Version.create!(project: project, name: row.first)
|
||||
|
||||
vs = version.version_settings.build
|
||||
vs.project = project
|
||||
vs.display_right!
|
||||
vs.save!
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "(.+?)")? has the following stories in the following (?:product )?(?:owner )?backlogs:$/ do |project_name, table|
|
||||
if project_name
|
||||
step %{the project "#{project_name}" has the following stories in the following sprints:}, table
|
||||
else
|
||||
step 'the project has the following stories in the following sprints:', table
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following stories in the following sprints:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
project.work_packages.destroy_all
|
||||
prev_id = ''
|
||||
|
||||
table.hashes.each do |story|
|
||||
params = initialize_story_params(project)
|
||||
params['parent'] = WorkPackage.find_by(subject: story['parent'])
|
||||
params['subject'] = story['subject']
|
||||
params['version_id'] = Version.find_by(name: story['sprint'] || story['backlog']).id
|
||||
params['story_points'] = story['story_points']
|
||||
params['status'] = if story['status']
|
||||
Status.find_by(name: story['status'])
|
||||
else
|
||||
Status.default
|
||||
end
|
||||
params['type_id'] = Type.find_by(name: story['type']).id if story['type']
|
||||
params['priority'] = if story['priority']
|
||||
IssuePriority.find_by(name: story['priority'])
|
||||
else
|
||||
IssuePriority.default
|
||||
end
|
||||
|
||||
params.delete 'position'
|
||||
# NOTE: We're bypassing the controller here because we're just
|
||||
# setting up the database for the actual tests. The actual tests,
|
||||
# however, should NOT bypass the controller
|
||||
s = Story.create!(params.merge(project: params[:project], author: params['author']))
|
||||
s.move_after(prev_id) unless prev_id.blank?
|
||||
prev_id = s.id
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following tasks:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
User.current = User.first
|
||||
|
||||
as_admin do
|
||||
table.hashes.each do |task|
|
||||
story = Story.find_by(subject: task['parent'])
|
||||
params = initialize_task_params(project, story)
|
||||
params['subject'] = task['subject']
|
||||
params['project_id'] = project.id
|
||||
params['status'] = if task['status']
|
||||
Status.find_by(name: story['task'])
|
||||
else
|
||||
Status.default
|
||||
end
|
||||
params['priority'] = if task['priority']
|
||||
IssuePriority.find_by(name: task['priority'])
|
||||
else
|
||||
IssuePriority.default
|
||||
end
|
||||
|
||||
# NOTE: We're bypassing the controller here because we're just
|
||||
# setting up the database for the actual tests. The actual tests,
|
||||
# however, should NOT bypass the controller
|
||||
Task.create!(params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following work_packages:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
User.current = User.first
|
||||
|
||||
as_admin do
|
||||
table.hashes.each do |task|
|
||||
parent = WorkPackage.find_by(subject: task['parent'])
|
||||
type = Type.find_by(name: task['type'])
|
||||
params = initialize_work_package_params(project, type, parent)
|
||||
params['subject'] = task['subject']
|
||||
version = Version.find_by(name: task['sprint'] || task['backlog'])
|
||||
params['version_id'] = version.id if version
|
||||
params['priority'] = if task['priority']
|
||||
IssuePriority.find_by(name: task['priority'])
|
||||
else
|
||||
IssuePriority.default
|
||||
end
|
||||
|
||||
# NOTE: We're bypassing the controller here because we're just
|
||||
# setting up the database for the actual tests. The actual tests,
|
||||
# however, should NOT bypass the controller
|
||||
work_package = WorkPackage.new
|
||||
work_package.attributes = params
|
||||
work_package.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Given /^the [pP]roject(?: "([^\"]*)")? has the following impediments:$/ do |project_name, table|
|
||||
project = get_project(project_name)
|
||||
|
||||
User.current = User.first
|
||||
|
||||
as_admin do
|
||||
table.hashes.each do |impediment|
|
||||
sprint = Sprint.find_by(name: impediment['sprint'])
|
||||
blocks = Story.where(subject: impediment['blocks'].split(', ')).pluck(:id)
|
||||
params = initialize_impediment_params(project, sprint)
|
||||
params['subject'] = impediment['subject']
|
||||
params['blocks_ids'] = blocks.join(',')
|
||||
params['project_id'] = project.id
|
||||
params['priority'] = if impediment['priority']
|
||||
IssuePriority.find_by(name: impediment['priority'])
|
||||
else
|
||||
IssuePriority.default
|
||||
end
|
||||
|
||||
# NOTE: We're bypassing the controller here because we're just
|
||||
# setting up the database for the actual tests. The actual tests,
|
||||
# however, should NOT bypass the controller
|
||||
Impediment.create!(params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Given /^I have set my API access key$/ do
|
||||
Setting[:rest_api_enabled] = 1
|
||||
User.current.reload
|
||||
User.current.api_key.should_not be_nil
|
||||
@api_key = User.current.api_key
|
||||
end
|
||||
|
||||
Given /^I have guessed an API access key$/ do
|
||||
Setting[:rest_api_enabled] = 1
|
||||
@api_key = 'guess'
|
||||
end
|
||||
|
||||
Given /^I have set the content for wiki page (.+) to (.+)$/ do |title, content|
|
||||
page = @project.wiki.find_page(title)
|
||||
if !page
|
||||
page = WikiPage.new(wiki: @project.wiki, title: title)
|
||||
page.content = WikiContent.new
|
||||
page.save
|
||||
end
|
||||
|
||||
page.content.text = content
|
||||
page.save.should be_truthy
|
||||
end
|
||||
|
||||
Given /^I have made (.+) the template page for sprint notes/ do |title|
|
||||
Setting.plugin_openproject_backlogs = Setting.plugin_openproject_backlogs.merge('wiki_template' => title)
|
||||
end
|
||||
|
||||
Given /^there are no stories in the [pP]roject$/ do
|
||||
@project.work_packages.delete_all
|
||||
end
|
||||
|
||||
Given /^the type "(.+?)" is configured to track tasks$/ do |type_name|
|
||||
type = Type.find_by(name: type_name)
|
||||
type = FactoryBot.create(:type, name: type_name) if type.blank?
|
||||
|
||||
Setting.plugin_openproject_backlogs = Setting.plugin_openproject_backlogs.merge('task_type' => type.id)
|
||||
end
|
||||
|
||||
Given /^the following types are configured to track stories:$/ do |table|
|
||||
story_types = []
|
||||
table.raw.each do |line|
|
||||
name = line.first
|
||||
type = Type.find_by(name: name)
|
||||
|
||||
type = FactoryBot.create(:type, name: name) if type.blank?
|
||||
story_types << type
|
||||
end
|
||||
|
||||
# otherwise the type id's from the previous test are still active
|
||||
WorkPackage.instance_variable_set(:@backlogs_types, nil)
|
||||
|
||||
Setting.plugin_openproject_backlogs = Setting.plugin_openproject_backlogs.merge('story_types' => story_types.map(&:id))
|
||||
end
|
||||
|
||||
Given /^the [tT]ype(?: "([^\"]*)")? has for the Role "(.+?)" the following workflows:$/ do |type_name, role_name, table|
|
||||
role = Role.find_by(name: role_name)
|
||||
type = Type.find_by(name: type_name)
|
||||
|
||||
type.workflows = []
|
||||
table.hashes.each do |workflow|
|
||||
old_status = Status.find_by(name: workflow['old_status']).id
|
||||
new_status = Status.find_by(name: workflow['new_status']).id
|
||||
type.workflows.build(old_status_id: old_status, new_status_id: new_status, role: role)
|
||||
end
|
||||
type.save!
|
||||
end
|
||||
|
||||
Given /^the status of "([^"]*)" is "([^"]*)"$/ do |work_package_subject, status_name|
|
||||
s = WorkPackage.find_by(subject: work_package_subject)
|
||||
s.status = Status.find_by(name: status_name)
|
||||
s.save!
|
||||
end
|
||||
|
||||
Given /^there is the single default export card configuration$/ do
|
||||
config = ExportCardConfiguration.create!(name: 'Default',
|
||||
per_page: 1,
|
||||
page_size: 'A4',
|
||||
orientation: 'landscape',
|
||||
rows: "group1:\n has_border: false\n rows:\n row1:\n height: 50\n priority: 1\n columns:\n id:\n has_label: false")
|
||||
end
|
||||
@@ -1,264 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then /^(.+) should be in the (\d+)(?:st|nd|rd|th) position of the sprint named (.+)$/ do |story_subject, position, sprint_name|
|
||||
position = position.to_i
|
||||
story = Story.where(subject: story_subject, versions: { name: sprint_name }).joins(:version).first
|
||||
story_position(story).should == position.to_i
|
||||
end
|
||||
|
||||
Then /^I should see (\d+) (?:product )?owner backlogs$/ do |count|
|
||||
sprint_backlogs = page.all(:css, '#owner_backlogs_container .sprint')
|
||||
sprint_backlogs.length.should == count.to_i
|
||||
end
|
||||
|
||||
Then /^I should see (\d+) sprint backlogs$/ do |count|
|
||||
sprint_backlogs = page.all(:css, '#sprint_backlogs_container .sprint')
|
||||
sprint_backlogs.length.should == count.to_i
|
||||
end
|
||||
|
||||
Then /^I should see the burndown chart for sprint "(.+?)"$/ do |sprint|
|
||||
sprint = Sprint.find_by(name: sprint)
|
||||
|
||||
page.should have_css("#burndown_#{sprint.id}")
|
||||
end
|
||||
|
||||
Then /^I should see the WorkPackages page$/ do
|
||||
page.should have_css('.workpackages-table')
|
||||
end
|
||||
|
||||
Then /^I should see the taskboard$/ do
|
||||
page.should have_css('#taskboard')
|
||||
end
|
||||
|
||||
Then /^I should see the product backlog$/ do
|
||||
page.should have_css('#owner_backlogs_container')
|
||||
end
|
||||
|
||||
Then /^I should see (\d+) stories in (?:the )?"(.+?)"$/ do |count, backlog_name|
|
||||
sprint = Sprint.find_by(name: backlog_name)
|
||||
page.all(:css, "#backlog_#{sprint.id} .story").size.should == count.to_i
|
||||
end
|
||||
|
||||
Then /^the velocity of "(.+?)" should be "(.+?)"$/ do |backlog_name, velocity|
|
||||
sprint = Sprint.find_by(name: backlog_name)
|
||||
page.find(:css, "#backlog_#{sprint.id} .velocity").text.should == velocity
|
||||
end
|
||||
|
||||
Then /^show me the list of sprints$/ do
|
||||
sprints = Sprint.where(project_id: @project.id)
|
||||
|
||||
puts "\n"
|
||||
puts "\t| #{'id'.ljust(3)} | #{'name'.ljust(18)} | #{'start_date'.ljust(18)} | #{'effective_date'.ljust(18)} | #{'updated_on'.ljust(20)}"
|
||||
sprints.each do |sprint|
|
||||
puts "\t| #{sprint.id.to_s.ljust(3)} | #{sprint.name.to_s.ljust(18)} | #{sprint.start_date.to_s.ljust(18)} | #{sprint.effective_date.to_s.ljust(18)} | #{sprint.updated_on.to_s.ljust(20)} |"
|
||||
end
|
||||
puts "\n\n"
|
||||
end
|
||||
|
||||
Then /^show me the list of stories$/ do
|
||||
stories = Story.where(project_id: @project.id).order(Arel.sql('position ASC'))
|
||||
subject_max = (stories.map(&:subject) << 'subject').sort { |a, b| a.length <=> b.length }.last.length
|
||||
sprints = @project.versions
|
||||
sprint_max = (sprints.map(&:name) << 'sprint').sort { |a, b| a.length <=> b.length }.last.length
|
||||
|
||||
puts "\n"
|
||||
puts "\t| #{'id'.ljust(5)} | #{'position'.ljust(8)} | #{'status'.ljust(12)} | #{'rank'.ljust(4)} | #{'subject'.ljust(subject_max)} | #{'sprint'.ljust(sprint_max)} |"
|
||||
stories.each do |story|
|
||||
puts "\t| #{story.id.to_s.ljust(5)} | #{story.position.to_s.ljust(8)} | #{story.status.name[0, 12].ljust(12)} | #{story.rank.to_s.ljust(4)} | #{story.subject.ljust(subject_max)} | #{(story.version_id.nil? ? Sprint.new : Sprint.find(story.version_id)).name.ljust(sprint_max)} |"
|
||||
end
|
||||
puts "\n\n"
|
||||
end
|
||||
|
||||
Then /^(.+) should be the higher (story|item|task) of (.+)$/ do |higher_subject, type, lower_subject|
|
||||
work_package_class = (type == 'task') ? Task : Story
|
||||
|
||||
higher = work_package_class.where(subject: higher_subject)
|
||||
higher.length.should == 1
|
||||
|
||||
lower = work_package_class.where(subject: lower_subject)
|
||||
lower.length.should == 1
|
||||
|
||||
lower.first.higher_item.id.should == higher.first.id
|
||||
end
|
||||
|
||||
Then /^the request should complete successfully$/ do
|
||||
RequestStore[:response].status.should == 200
|
||||
end
|
||||
|
||||
Then /^the request should fail$/ do
|
||||
RequestStore[:response].status.should == 401
|
||||
end
|
||||
|
||||
Then /^the (\d+)(?:st|nd|rd|th) story in (?:the )?"(.+?)" should be "(.+)"$/ do |position, version_name, subject|
|
||||
sleep 2
|
||||
version = Version.find_by(name: version_name)
|
||||
story = Story.at_rank(@project.id, version.id, position.to_i)
|
||||
story.should_not be_nil
|
||||
story.subject.should == subject
|
||||
end
|
||||
|
||||
Then /^the (\d+)(?:st|nd|rd|th) story in (?:the )?"(.+?)" should be in the "(.+?)" type$/ do |position, version_name, type_name|
|
||||
version = Version.find_by(name: version_name)
|
||||
type = Type.find_by(name: type_name)
|
||||
story = Story.at_rank(@project.id, version.id, position.to_i)
|
||||
story.should_not be_nil
|
||||
story.type.should == type
|
||||
end
|
||||
|
||||
Then /^the (\d+)(?:st|nd|rd|th) story in (?:the )?"(.+?)" should have the ID of "(.+?)"$/ do |position, version_name, subject|
|
||||
version = Version.find_by(name: version_name)
|
||||
actual_story = WorkPackage.find_by(subject: subject, version_id: version.id)
|
||||
step %%I should see "#{actual_story.id}" within "#backlog_#{version.id} .story:nth-child(#{position}) .id div.t"%
|
||||
end
|
||||
|
||||
Then /^all positions should be unique for each version$/ do
|
||||
Story.find_by_sql("select project_id, version_id, position, count(*) as dups from #{WorkPackage.table_name} where not position is NULL group by project_id, version_id, position having count(*) > 1").length.should == 0
|
||||
end
|
||||
|
||||
Then /^the (\d+)(?:st|nd|rd|th) task for (.+) should be (.+)$/ do |position, story_subject, task_subject|
|
||||
story = Story.find_by(subject: story_subject)
|
||||
expect(story.children.order(position: :asc)[position.to_i - 1].subject)
|
||||
.to eql(task_subject)
|
||||
end
|
||||
|
||||
Then /^the server should return an update error$/ do
|
||||
RequestStore[:response].status.should == 400
|
||||
end
|
||||
|
||||
Then /^the server should return (\d+) updated (.+)$/ do |count, object_type|
|
||||
page.all("##{object_type.pluralize} .#{object_type.singularize}").length.should == count.to_i
|
||||
end
|
||||
|
||||
Then /^the sprint named (.+) should have (\d+) impediments? named (.+)$/ do |sprint_name, count, impediment_subject|
|
||||
sprints = Sprint.where(name: sprint_name)
|
||||
sprints.length.should == 1
|
||||
|
||||
sprints.first.impediments.map { |i| i.subject == impediment_subject }.length.should == count.to_i
|
||||
end
|
||||
|
||||
Then /^the impediment "(.+)" should signal( | un)successful saving$/ do |impediment_subject, negative|
|
||||
pos_or_neg_should = !negative.blank? ? :should : :should_not
|
||||
|
||||
page.send(pos_or_neg_should, have_selector('div.impediment.error', text: impediment_subject))
|
||||
end
|
||||
|
||||
Then /^the sprint should be updated accordingly$/ do
|
||||
sprint = Sprint.find(@sprint_params['id'])
|
||||
|
||||
sprint.attributes.each_key do |key|
|
||||
unless ['updated_on', 'created_on'].include?(key)
|
||||
(key.include?('_date') ? sprint[key].strftime('%Y-%m-%d') : sprint[key]).should == @sprint_params[key]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the status of the story should be set as (.+)$/ do |status|
|
||||
@story.reload
|
||||
@story.status.name.downcase.should == status
|
||||
end
|
||||
|
||||
Then /^the story named (.+) should have 1 task named (.+)$/ do |story_subject, task_subject|
|
||||
stories = Story.where(subject: story_subject)
|
||||
stories.length.should == 1
|
||||
|
||||
tasks = Task
|
||||
.children_of(stories.first)
|
||||
.where(subject: task_subject)
|
||||
tasks.length.should == 1
|
||||
end
|
||||
|
||||
Then /^the story should be at the (top|bottom)$/ do |position|
|
||||
if position == 'top'
|
||||
story_position(@story).should == 1
|
||||
else
|
||||
story_position(@story).should == @story_ids.length
|
||||
end
|
||||
end
|
||||
|
||||
Then /^the story should be at position (.+)$/ do |position|
|
||||
story_position(@story).should == position.to_i
|
||||
end
|
||||
|
||||
Then /^the story should have a (.+) of (.+)$/ do |attribute, value|
|
||||
@story.reload
|
||||
if attribute == 'type'
|
||||
attribute = 'type_id'
|
||||
value = Type.find_by(name: value).id
|
||||
end
|
||||
@story[attribute].should == value
|
||||
end
|
||||
|
||||
Then /^the wiki page (.+) should contain (.+)$/ do |title, content|
|
||||
page = @project.wiki.find_page(title)
|
||||
page.should_not be_nil
|
||||
|
||||
raise "\"#{content}\" not found on page \"#{title}\"" unless page.content.text.match(/#{content}/)
|
||||
end
|
||||
|
||||
Then /^(work_package|task|story) (.+) should have (.+) set to (.+)$/ do |_type, subject, attribute, value|
|
||||
work_package = WorkPackage.find_by(subject: subject)
|
||||
work_package[attribute].should == value.to_i
|
||||
end
|
||||
|
||||
Then /^the error alert should show "(.+?)"$/ do |msg|
|
||||
step %{I should see "#{msg}" within "#msgBox"}
|
||||
end
|
||||
|
||||
Then /^the start date of "(.+?)" should be "(.+?)"$/ do |sprint_name, date|
|
||||
version = Version.find_by(name: sprint_name)
|
||||
|
||||
step %{I should see "#{date}" within "div#sprint_#{version.id} div.start_date"}
|
||||
end
|
||||
|
||||
Then /^I should see "(.+?)" as a task to story "(.+?)"$/ do |task_name, story_name|
|
||||
story = Story.find_by(subject: story_name)
|
||||
|
||||
step %{I should see "#{task_name}" within "tr.story_#{story.id}"}
|
||||
end
|
||||
|
||||
Then /^the (?:work_package|task|story) "(.+?)" should have "(.+?)" as its target version$/ do |task_name, version_name|
|
||||
work_package = WorkPackage.find_by(subject: task_name)
|
||||
version = Version.find_by(name: version_name)
|
||||
|
||||
work_package.version.should eql version
|
||||
end
|
||||
|
||||
Then /^there should not be a saving error on task "(.+?)"$/ do |task_name|
|
||||
elements = all(:xpath, "//*[contains(., \"#{task_name}\")]")
|
||||
task_div = elements.find { |e| e.tag_name == 'div' && e[:class].include?('task') }
|
||||
task_div[:class].should_not include('error')
|
||||
end
|
||||
|
||||
Then /^I should be notified that the work_package "(.+?)" is an invalid parent to the work_package "(.+?)" because of cross project limitations$/ do |parent_name, child_name|
|
||||
step %{I should see "Parent is invalid because the work package '#{child_name}' is a backlog task and therefore cannot have a parent outside of the current project." within "#errorExplanation"}
|
||||
end
|
||||
|
||||
Then /^the PDF download dialog should be displayed$/ do
|
||||
# As far as I'm aware there's nothing that can be done here to check for this.
|
||||
end
|
||||
@@ -1,272 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
def perform_post(url, params = {})
|
||||
session = page.get_rack_session
|
||||
driver = Capybara.current_driver
|
||||
begin
|
||||
Capybara.current_driver = :rack_test
|
||||
page.set_rack_session(session)
|
||||
RequestStore[:response] = page.driver.post(url, params)
|
||||
rescue StandardError => e
|
||||
warn "Failed to perform rack request: #{e}"
|
||||
raise e
|
||||
ensure
|
||||
Capybara.current_driver = driver
|
||||
page.set_rack_session(session)
|
||||
end
|
||||
end
|
||||
|
||||
When /^I create the impediment$/ do
|
||||
perform_post backlogs_project_sprint_impediments_url(
|
||||
*@impediment_params.values_at('project_id', 'version_id')
|
||||
), @impediment_params.except('author_id', 'author')
|
||||
end
|
||||
|
||||
When /^I create the story$/ do
|
||||
perform_post backlogs_project_sprint_stories_url(
|
||||
*@story_params.values_at('project_id', 'version_id')
|
||||
), @story_params.except('author_id', 'author')
|
||||
end
|
||||
|
||||
When /^I create the task$/ do
|
||||
perform_post backlogs_project_sprint_tasks_url(
|
||||
*@task_params.values_at('project_id', 'version_id')
|
||||
), @task_params.except('author_id', 'author')
|
||||
end
|
||||
|
||||
When /^I move the (story|item|task) named (.+) below (.+)$/ do |type, story_subject, prev_subject|
|
||||
work_package_class = if type.strip == 'task' then Task else Story end
|
||||
story = work_package_class.find_by(subject: story_subject.strip)
|
||||
prev = work_package_class.find_by(subject: prev_subject.strip)
|
||||
|
||||
attributes = story.attributes
|
||||
attributes[:prev] = prev.id
|
||||
|
||||
if type == 'task'
|
||||
# #attributes returns the parent_id to always be nil
|
||||
attributes['parent_id'] = story.parent_id
|
||||
else
|
||||
attributes[:version_id] = prev.version_id
|
||||
end
|
||||
|
||||
project = Project.find(attributes['project_id'])
|
||||
sprint = prev.version
|
||||
|
||||
perform_post polymorphic_url(
|
||||
[:backlogs, project, sprint.becomes(Sprint), story]
|
||||
), attributes.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I move the story named (.+) (up|down) to the (\d+)(?:st|nd|rd|th) position of the sprint named (.+)$/ do |story_subject, direction, position, sprint_name|
|
||||
position = position.to_i
|
||||
story = Story.find_by(subject: story_subject)
|
||||
sprint = Sprint.find_by(name: sprint_name)
|
||||
story.version = sprint
|
||||
|
||||
attributes = story.attributes
|
||||
attributes[:prev] = if position == 1
|
||||
''
|
||||
else
|
||||
stories = Story.where(version_id: sprint.id, type_id: Story.types).order(Arel.sql('position ASC'))
|
||||
raise "You indicated an invalid position (#{position}) in a sprint with #{stories.length} stories" if 0 > position or position > stories.length
|
||||
stories[position - (direction == 'up' ? 2 : 1)].id
|
||||
end
|
||||
|
||||
perform_post backlogs_project_sprint_story_url(
|
||||
*attributes.values_at('project_id', 'version_id', 'id')
|
||||
), attributes.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? position$/ do |old_pos, new_pos|
|
||||
@story_ids = page.all(:css, '#owner_backlogs_container .stories .story .id')
|
||||
|
||||
story = @story_ids[old_pos.to_i - 1]
|
||||
story.should_not == nil
|
||||
|
||||
prev = if new_pos.to_i == 1
|
||||
nil
|
||||
elsif new_pos == 'last'
|
||||
@story_ids.last
|
||||
elsif old_pos.to_i > new_pos.to_i
|
||||
@story_ids[new_pos.to_i - 2]
|
||||
else
|
||||
@story_ids[new_pos.to_i - 1]
|
||||
end
|
||||
|
||||
@story = Story.find(story.text.to_i)
|
||||
|
||||
perform_post backlogs_project_sprint_story_url(
|
||||
@project.id,
|
||||
@story.version_id,
|
||||
@story.id
|
||||
), prev: (prev.nil? ? '' : prev.text), '_method' => 'put'
|
||||
end
|
||||
|
||||
When /^I update the impediment$/ do
|
||||
perform_post backlogs_project_sprint_impediment_url(
|
||||
*@impediment_params.values_at('project_id', 'version_id', 'id')
|
||||
), @impediment_params.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I update the sprint$/ do
|
||||
perform_post backlogs_project_sprint_url(
|
||||
*@sprint_params.values_at('project_id', 'id')
|
||||
), @sprint_params.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I update the story$/ do
|
||||
perform_post backlogs_project_sprint_story_url(
|
||||
*@story_params.values_at('project_id', 'version_id', 'id')
|
||||
), @story_params.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I update the task$/ do
|
||||
perform_post backlogs_project_sprint_task_url(
|
||||
*@task_params.values_at('project_id', 'version_id', 'id')
|
||||
), @task_params.merge('_method' => 'put')
|
||||
end
|
||||
|
||||
When /^I view the master backlog$/ do
|
||||
visit url_for(controller: '/projects', action: :show, id: @project)
|
||||
click_link('Backlogs')
|
||||
end
|
||||
|
||||
When /^I view the stories of (.+) in the work_packages tab/ do |sprint_name|
|
||||
sprint = Sprint.find_by(name: sprint_name)
|
||||
visit url_for(controller: '/rb_queries', action: :show, project_id: sprint.project, sprint_id: sprint, only_path: true)
|
||||
end
|
||||
|
||||
When /^I view the stories in the work_packages tab/ do
|
||||
visit url_for(controller: '/rb_queries', action: :show, project_id: @project, only_path: true)
|
||||
end
|
||||
|
||||
# WARN: Depends on deprecated behavior of path_for('the task board for
|
||||
# "sprint name"')
|
||||
When /^I view the sprint notes$/ do
|
||||
visit url_for(controller: '/rb_wikis', action: 'show', sprint_id: @sprint, project_id: @project)
|
||||
end
|
||||
|
||||
# WARN: Depends on deprecated behavior of path_for('the task board for
|
||||
# "sprint name"')
|
||||
When /^I edit the sprint notes$/ do
|
||||
visit url_for(controller: '/rb_wikis', action: 'edit', sprint_id: @sprint, project_id: @project)
|
||||
end
|
||||
|
||||
When /^I follow "(.+?)" of the "(.+?)" (?:backlogs )?menu$/ do |link, backlog_name|
|
||||
sprint = Sprint.find_by(name: backlog_name)
|
||||
step %{I follow "#{link}" within "#backlog_#{sprint.id} .menu"}
|
||||
end
|
||||
|
||||
When /^I open the "(.+?)" backlogs(?: )?menu/ do |backlog_name|
|
||||
sprint = Sprint.find_by(name: backlog_name)
|
||||
find(:css, "#backlog_#{sprint.id} .menu > div").click
|
||||
end
|
||||
|
||||
When /^I close the "(.+?)" backlogs(?: )?menu/ do |backlog_name|
|
||||
sprint = Sprint.find_by(name: backlog_name)
|
||||
step %{I stop hovering over "#backlog_#{sprint.id} .menu"}
|
||||
end
|
||||
|
||||
When /^I click on the text "(.+?)"$/ do |locator|
|
||||
expect(page)
|
||||
.to have_content(locator)
|
||||
find(:xpath, %{//*[contains(text(), "#{locator}")]}).click
|
||||
end
|
||||
|
||||
When /^I click on the link on the modal window with text "(.+?)"$/ do |locator|
|
||||
browser = page.driver.browser
|
||||
browser.switch_to.frame('modalIframe')
|
||||
click_link(locator)
|
||||
end
|
||||
|
||||
When /^I click on the element with class "([^"]+?)"$/ do |locator|
|
||||
find(:css, ".#{locator}").click
|
||||
end
|
||||
|
||||
When /^I confirm the story form$/ do
|
||||
find(:css, 'input[name=subject]').native.send_key :return
|
||||
step 'I wait for AJAX requests to finish'
|
||||
step 'I should not see ".saving"'
|
||||
end
|
||||
|
||||
When /^I fill in the ids of the (tasks|work_packages|stories) "(.+?)" for "(.+?)"$/ do |model_name, subjects, field|
|
||||
model = Kernel.const_get(model_name.classify)
|
||||
ids = subjects.split(/,/).map { |subject| model.find_by(subject: subject).id }
|
||||
|
||||
step %{I fill in "#{ids.join(', ')}" for "#{field}"}
|
||||
end
|
||||
|
||||
When /^I click on the impediment called "(.+?)"$/ do |impediment_name|
|
||||
step %{I click on the text "#{impediment_name}"}
|
||||
end
|
||||
|
||||
When /^I click to add a new task for story "(.+?)"$/ do |story_name|
|
||||
expect(page)
|
||||
.to have_content(story_name)
|
||||
|
||||
story = Story.find_by(subject: story_name)
|
||||
|
||||
find("tr.story_#{story.id} td.add_new").click
|
||||
end
|
||||
|
||||
When /^I fill in the id of the work_package "(.+?)" as the parent work_package$/ do |work_package_name|
|
||||
work_package = WorkPackage.find_by(subject: work_package_name)
|
||||
|
||||
# TODO: Simplify once the work_package#edit/update action is implemented
|
||||
find('#work_package_parent_id, #work_package_parent_id', visible: false).set(work_package.id)
|
||||
end
|
||||
|
||||
When /^the request on task "(.+?)" is finished$/ do |task_name|
|
||||
# Wait for the modal link of this task to appear...
|
||||
elements = page.find(:xpath, "//div[contains(., '#{task_name}') and contains(@class,'task')]/descendant::a[contains(@href, .)]")
|
||||
# ...by selecting the task board card for a specific task and then go for the
|
||||
# link with the id only appearing after the task was saved
|
||||
end
|
||||
|
||||
When /^I follow the link to add a subtask$/ do
|
||||
step 'I follow "Relations"'
|
||||
step 'I click "Children"'
|
||||
step 'I press "Add child"'
|
||||
end
|
||||
|
||||
When /^I change the fold state of a version$/ do
|
||||
find('.backlog .toggler').click
|
||||
end
|
||||
|
||||
When /^I click on the Export link$/ do
|
||||
click_link('Export')
|
||||
end
|
||||
|
||||
When(/^I click on the link for the story "(.*?)"$/) do |subject|
|
||||
story = Story.find_by(subject: subject)
|
||||
|
||||
within("#story_#{story.id}") do
|
||||
click_link(story.id)
|
||||
end
|
||||
end
|
||||
@@ -1,110 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
def initialize_story_params(project, user = User.current)
|
||||
data = Story.new.attributes.slice(RbStoriesController::PERMITTED_PARAMS)
|
||||
story = HashWithIndifferentAccess.new(data)
|
||||
story['type_id'] = Story.types.first
|
||||
|
||||
# unsafe attributes that will not be used directly but added for your
|
||||
# convenience
|
||||
story['project_id'] = project.id
|
||||
story['author_id'] = user.id
|
||||
story['project'] = project
|
||||
story['author'] = user
|
||||
story
|
||||
end
|
||||
|
||||
def initialize_task_params(project, story, user = User.first)
|
||||
params = HashWithIndifferentAccess.new
|
||||
params['type_id'] = Task.type
|
||||
if story
|
||||
params['version_id'] = story.version_id
|
||||
params['parent_id'] = story.id
|
||||
end
|
||||
params['status_id'] = Status.first.id
|
||||
|
||||
# unsafe attributes that will not be used directly but added for your
|
||||
# convenience
|
||||
params['project_id'] = project.id
|
||||
params['author_id'] = user.id
|
||||
params['project'] = project
|
||||
params['author'] = user
|
||||
params
|
||||
end
|
||||
|
||||
def initialize_work_package_params(project, type = Type.first, parent = nil, user = User.first)
|
||||
params = HashWithIndifferentAccess.new
|
||||
params['type_id'] = type.id
|
||||
params['parent_id'] = parent.id if parent
|
||||
params['status_id'] = Status.first.id
|
||||
|
||||
# unsafe attributes that will not be used directly but added for your
|
||||
# convenience
|
||||
params['project_id'] = project.id
|
||||
params['author_id'] = user.id
|
||||
params['project'] = project
|
||||
params['author'] = user
|
||||
params
|
||||
end
|
||||
|
||||
def initialize_impediment_params(project, sprint, user = User.first)
|
||||
params = HashWithIndifferentAccess.new(RbTasksController::PERMITTED_PARAMS)
|
||||
params['type_id'] = Task.type
|
||||
params['version_id'] = sprint.id
|
||||
params['status_id'] = Status.first.id
|
||||
|
||||
# unsafe attributes that will not be used directly but added for your
|
||||
# convenience
|
||||
params['project_id'] = project.id
|
||||
params['author_id'] = user.id
|
||||
params['project'] = project
|
||||
params['author'] = user
|
||||
params
|
||||
end
|
||||
|
||||
def task_position(task)
|
||||
p1 = task.story.tasks.select { |t| t.id == task.id }[0].rank
|
||||
p2 = task.rank
|
||||
p1.should == p2
|
||||
p1
|
||||
end
|
||||
|
||||
def story_position(story)
|
||||
p1 = Story.sprint_backlog(story.project, story.version).detect { |s| s.id == story.id }.rank
|
||||
p2 = story.rank
|
||||
p1.should == p2
|
||||
|
||||
Story.at_rank(story.project_id, story.version_id, p1).id.should == story.id
|
||||
p1
|
||||
end
|
||||
|
||||
def logout
|
||||
visit url_for(controller: '/account', action: 'logout')
|
||||
@user = nil
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
Then /^the sprint "(.+?)" should be displayed to the (right|left)$/ do |sprint_name, orientation|
|
||||
selector = case orientation
|
||||
when 'right'
|
||||
'#owner_backlogs_container'
|
||||
when 'left'
|
||||
'#sprint_backlogs_container'
|
||||
else
|
||||
raise 'Only right and left are supported'
|
||||
end
|
||||
|
||||
step %{I should see "#{sprint_name}" within "#{selector} .name"}
|
||||
end
|
||||
@@ -1,70 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then(/^the available status of the story called "(.+?)" should be the following:$/) do |story_name, table|
|
||||
# the order of the available status is important
|
||||
story = Story.find_by(subject: story_name)
|
||||
|
||||
within("#story_#{story.id} .editors") do
|
||||
table.raw.flatten.each do |option_text|
|
||||
should have_select('status_id', text: option_text)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^the displayed attributes of the story called "(.+?)" should be the following:$/) do |story_name, table|
|
||||
story = Story.find_by(subject: story_name)
|
||||
|
||||
within("#story_#{story.id}") do
|
||||
table.rows_hash.each do |key, value|
|
||||
case key
|
||||
when 'Status'
|
||||
within('.status_id') do
|
||||
should have_selector('div.t', text: value)
|
||||
end
|
||||
else
|
||||
raise 'Not an implemented attribute'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^the editable attributes of the story called "(.+?)" should be the following:$/) do |story_name, table|
|
||||
story = Story.find_by(subject: story_name)
|
||||
|
||||
within("#story_#{story.id} .editors") do
|
||||
table.rows_hash.each do |key, value|
|
||||
case key
|
||||
when 'Status'
|
||||
should have_select('status_id', text: value)
|
||||
else
|
||||
raise 'Not an implemented attribute'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,40 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Then(/^the editable attributes of the version should be the following:$/) do |table|
|
||||
table.rows_hash.each do |key, value|
|
||||
case key
|
||||
when 'Column in backlog'
|
||||
page.should have_select(key, selected: value)
|
||||
when 'Start date'
|
||||
page.should have_field(key, with: value)
|
||||
else
|
||||
raise 'Not an implemented attribute'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,72 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
module BacklogsNavigationHelpers
|
||||
# Maps a name to a path. Used by the
|
||||
#
|
||||
# When /^I go to (.+)$/ do |page_name|
|
||||
#
|
||||
# step definition in web_steps.rb
|
||||
#
|
||||
def path_to(page_name)
|
||||
case page_name
|
||||
when /^the master backlog(?: of the [pP]roject "(.+?)")?$/
|
||||
project = get_project($1)
|
||||
"/projects/#{project.identifier}/backlogs"
|
||||
|
||||
when /^the (:?overview ?)?page (?:for|of) the [pP]roject$/
|
||||
project = get_project
|
||||
path_to %{the overview page of the project called "#{project.name}"}
|
||||
|
||||
when /^the work_packages index page$/
|
||||
project = get_project
|
||||
path_to %{the work packages index page of the project called "#{project.name}"}
|
||||
|
||||
when /^the burndown for "(.+?)"(?: (?:in|of) the [pP]roject "(.+?)")?$/
|
||||
project = get_project($2)
|
||||
sprint = Sprint.find_by(name: $1, project: project)
|
||||
|
||||
"/projects/#{project.identifier}/sprints/#{sprint.id}/burndown_chart"
|
||||
|
||||
when /^the task ?board for "(.+?)"(?: (?:in|of) the [pP]roject "(.+?)")?$/
|
||||
project = get_project($2)
|
||||
sprint = Sprint.find_by(name: $1, project: project)
|
||||
|
||||
# WARN: Deprecated side effect to keep some old-style step definitions.
|
||||
# Do not depend on @sprint being set in new step definitions.
|
||||
@sprint = sprint
|
||||
|
||||
"/projects/#{project.identifier}/sprints/#{sprint.id}/taskboard"
|
||||
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
World(BacklogsNavigationHelpers)
|
||||
@@ -1,39 +0,0 @@
|
||||
#-- copyright
|
||||
# OpenProject is an open source project management software.
|
||||
# Copyright (C) 2012-2020 the OpenProject GmbH
|
||||
#
|
||||
# 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.
|
||||
#++
|
||||
|
||||
Feature: User settings
|
||||
|
||||
Scenario: A user can change its task color
|
||||
Given there is 1 user with the following:
|
||||
| login | bob |
|
||||
And I am already logged in as "bob"
|
||||
And I go to the my settings page
|
||||
And I fill in "Task color" with "#FBC4B3"
|
||||
And I submit the form by the "Save" button
|
||||
Then I should see "Account was successfully updated"
|
||||
And the "Task color" field should contain "#FBC4B3"
|
||||
@@ -246,5 +246,17 @@ describe 'Tasks on taskboard',
|
||||
expect(page)
|
||||
.to have_selector("a[href='#{backlogs_project_sprint_burndown_chart_path(project, sprint)}']",
|
||||
text: 'Burndown Chart')
|
||||
|
||||
# Tasks can get a color per assigned user
|
||||
visit my_settings_path
|
||||
|
||||
fill_in 'Task color', with: '#FBC4B3'
|
||||
|
||||
click_button 'Save'
|
||||
|
||||
taskboard_page.visit!
|
||||
|
||||
taskboard_page
|
||||
.expect_color_for_task('#FBC4B3', story1_task)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,6 +60,11 @@ module Pages
|
||||
.to have_no_content(work_package.subject)
|
||||
end
|
||||
|
||||
def expect_color_for_task(hex_color, task)
|
||||
expect(page)
|
||||
.to have_selector("#work_package_#{task.id}[style='background-color:#{hex_color};']")
|
||||
end
|
||||
|
||||
def add_task(story, attributes)
|
||||
find(".story_#{story.id} td.add_new").click
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<!---- copyright
|
||||
OpenProject Documents Plugin
|
||||
|
||||
Former OpenProject Core functionality extracted into a plugin.
|
||||
|
||||
Copyright (C) 2009-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 docs/COPYRIGHT.rdoc for more details.
|
||||
|
||||
++-->
|
||||
|
||||
# Changelog
|
||||
|
||||
## 3.0.8
|
||||
|
||||
* `#7679` Fix: Permissions not nested in 'documents' project module
|
||||
* `#5650` Fix: Acts as event datetime
|
||||
|
||||
## 1.0.1
|
||||
|
||||
* `#5361` Add missing journal data migration
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* `#3329` Refactor Duplicated Code Journals
|
||||
* `#5190` Public Release Documents plugin
|
||||
* Adaptations for new icon font
|
||||
|
||||
## 1.0.0.pre5
|
||||
|
||||
* `#2402` Activated migrations running from the plugin
|
||||
* Additional namespacing of hook partials to prevent clashes on activity view
|
||||
|
||||
## 1.0.0.pre4
|
||||
|
||||
* `#1875` Added document block to my project page
|
||||
|
||||
## 1.0.0.pre3
|
||||
|
||||
* Removed hard wiring to specific core version
|
||||
|
||||
## 1.0.0.pre2
|
||||
|
||||
* `#1602` Adaptions to Core acts_as_journalized_changes
|
||||
|
||||
## 1.0.0.pre1
|
||||
|
||||
* `#1631` Initial creation of Documents plugin
|
||||
@@ -1,63 +0,0 @@
|
||||
OpenProject Documents Plugin
|
||||
|
||||
This plugin adds features to connect and categorize documents with your project.
|
||||
|
||||
Former OpenProject Core functionality extracted into a plugin.
|
||||
|
||||
Copyright (C) 2009-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.
|
||||
|
||||
---
|
||||
|
||||
OpenProject is a derivative work based on ChiliProject, whose Copyright follows.
|
||||
|
||||
ChiliProject is a project management system.
|
||||
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
ChiliProject is a derivative work based on Redmine, whose Copyright follows.
|
||||
|
||||
Redmine - project management software
|
||||
Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
|
||||
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.
|
||||
@@ -1,28 +0,0 @@
|
||||
OpenProject Documents Plugin
|
||||
|
||||
Former OpenProject Core functionality extracted into a plugin.
|
||||
|
||||
Copyright (C) 2009-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 docs/COPYRIGHT.rdoc for more details.
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -77,7 +77,8 @@ describe 'Upload attachment to documents', js: true do
|
||||
expect(page).to have_content('Image uploaded on creation')
|
||||
|
||||
# Adding a second image
|
||||
find('.toolbar-items .button', text: 'Edit').click
|
||||
# We should be using the 'Edit' button at the top but that leads to flickering specs
|
||||
visit edit_document_path(document)
|
||||
|
||||
expect(page).to have_current_path "/documents/#{document.id}/edit", wait: 10
|
||||
editor.drag_attachment image_fixture, 'Image uploaded the second time'
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
OpenProject Meeting Plugin
|
||||
|
||||
This plugin adds functions to support project meetings to
|
||||
|
||||
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.
|
||||
@@ -1,17 +0,0 @@
|
||||
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.
|
||||
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -48,10 +48,6 @@ case "$1" in
|
||||
npm)
|
||||
cd frontend && npm run test
|
||||
;;
|
||||
plugins:cucumber)
|
||||
# we only support cucumber in the backlogs plugin/module anyway
|
||||
bundle exec rake cucumber:plugins
|
||||
;;
|
||||
*)
|
||||
bundle exec rake parallel:$1 -- --group-number $2 --only-group $3 --seed $CI_SEED
|
||||
esac
|
||||
|
||||
@@ -29,12 +29,6 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'roles routes', type: :routing do
|
||||
describe 'new' do
|
||||
it do
|
||||
expect(get('/roles/new')).to route_to('roles#new')
|
||||
end
|
||||
end
|
||||
|
||||
context 'admin scoped' do
|
||||
it {
|
||||
is_expected.to route(:get, 'admin/roles').to(controller: 'roles',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user