49 Commits

Author SHA1 Message Date
ulferts 1096e71cd8 global query deletion of own queries simplified 2026-02-25 13:14:22 +01:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
ulferts e904e530d8 remove WorkPackagePolicy 2025-04-14 16:16:48 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin 0b87ed9b6a remove newlines from context descriptions 2024-07-29 19:27:17 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Klaus Zanders 7394fa0f7a WorkPackagePolicy checks permission on work package 2023-11-27 10:22:47 +01:00
Klaus Zanders 0c2011216f Rename methods for mocking to allow_xxx schema
Co-authored-by: Christophe Bliard <c.bliard@openproject.com>
2023-10-16 08:41:06 +02:00
ulferts b105780206 mock permissions on project for now 2023-10-13 14:29:02 +02:00
Klaus Zanders 706bd8dfbb Remove bang 2023-10-09 10:49:02 +02:00
Klaus Zanders e3257c7667 Change calls using mocks on the user to our new mocking helper 2023-10-09 10:44:42 +02:00
Jonas Jabari 06fb90e423 Merge branch 'dev' into feature/15339-share-project-calendars-using-the-icalendar-format 2023-06-01 11:07:58 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Jonas Jabari a41fe0c64c finalized specs adjustments 2023-05-19 17:18:23 +02:00
Jonas Jabari 3267ac1a35 refactoring, bugfixing based on feedback, added first UI specs 2023-03-07 13:21:51 +08:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
ulferts 0fe90c21a7 rework hidden/starred of queries
The MenuItems::QueryMenuItems class used to map the `starred` state is replaced by a simple boolean flag. The hidden flag is removed (but still readable) as the concept of `View`s completely replaces it.
2021-12-10 17:37:45 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther bc06da3a00 [30231] Allow users edit_work_packages permission to save query
https://community.openproject.com/wp/30231
2019-05-22 11:56:49 +02:00
Jens Ulferts 395c665627 do not allow edit when user only has comment permission 2018-08-21 09:34:37 +02:00
Jens Ulferts 24bcf147f2 lift project restriction from children table 2018-07-17 12:46:30 +02:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Oliver Günther 688385428c Avoid multiple requires of spec_helper
https://github.com/rspec/rspec-core/issues/1076
2016-10-31 20:38:35 +01:00
Jens Ulferts 34b26a4ff4 add service specific for adding notes to a work package 2016-03-23 09:33:00 +01:00
Jan Sandbrink ca1616ae90 Merge remote-tracking branch 'upstream/release/4.2' into dev
Conflicts:
	Gemfile.lock
2015-09-17 11:35:29 +02:00
Oliver Günther a6b4372b09 Always preprocess URLs with CGI.unescape
This forces redirect URLs to always pass through the escaping process,
in order to process escaped paths (`/mysubdir/%2E%2E/secret/`).
2015-09-17 10:10:50 +02:00
Oliver Günther fcd450af3f Fix redirect vulnerability
`redirect_back_or_default` was vulnerable to some of the URLs found to
be vulnerable in redmine, such as `@test.foo`.

This commit extracts the whole functionality into a policy and alters
the constraints with a path check to avoid these cases.
Thanks to @marutosi for pointing this out.

http://www.redmine.org/projects/redmine/repository/revisions/14560
2015-09-15 09:30:31 +02:00
Alex Coles ce93701029 Fix syntax (w/Rubocop) in specs
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-06-30 12:08:28 +02:00
Alex Coles 3785fdc9ed Use #describe, #context with String arg not symbol
The semantics of `describe` have changed in RSpec 3: passing a symbol
rather than a string will change the value of the described object.

See discussion here: https://github.com/rspec/rspec-core/issues/1114

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-03-11 01:13:11 -03:00
Alex Coles 944b89d83e Convert specs to RSpec 3.2.0 syntax with Transpec
This conversion is done by Transpec 3.0.7 with the following command:
    transpec -f

* 34 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 14 conversions
    from: obj.stub_chain(:message1, :message2)
      to: allow(obj).to receive_message_chain(:message1, :message2)

* 7 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 4 conversions
    from: be_true
      to: be_truthy

* 3 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 2 conversions
    from: failure_message_for_should { }
      to: failure_message { }

* 2 conversions
    from: failure_message_for_should_not { }
      to: failure_message_when_negated { }

* 1 conversion
    from: Klass.any_instance.stub(:message => value)
      to: allow_any_instance_of(Klass).to receive_messages(:message => value)

* 1 conversion
    from: be_false
      to: be_falsey

* 1 conversion
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 1 conversion
    from: stub('something')
      to: double('something')

* 1 addition
      of: RSpec.configure { |c| c.infer_spec_type_from_file_location! }

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2015-03-10 19:59:02 -03:00
Alex Coles e0191e759c Update year in copyright header to 2015
[ci skip]
2015-01-01 00:02:57 +00:00
Alex Coles 5afc11f19e Fix syntax (w/Rubocop) in specs
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-04 00:50:36 +01:00
Hagen Schink 478b2c8859 Test manage subtasks policy 2014-10-24 15:57:04 +02:00
Philipp Tessenow d7d1158d15 add specs for QueryPolicy:show 2014-10-14 16:20:25 +02:00
Hagen Schink 5d08947580 Test correct query deletion verb 2014-10-07 08:23:06 +02:00
Jens Ulferts f7d92b156e fixes permission links on query 2014-10-02 16:53:54 +02:00
Jens Ulferts 4817547d4a introduces policies
The pattern used here is taken from pundit although this here does by
far not have the functionality pundit offers.
2014-10-02 16:53:54 +02:00