- Fix namespace resolution under some circumstances
- Fix composability support
- Add
*_attribute(s)
matchers for uniformity with*_action(s)
- Allow to match dynamically defined actions
- Drop RSpec < 3.12 and Pundit < 2 compatibility
- Eliminate ambiguity of negated matchers
- Add support for configuring user alias per policy
- Add support for nested attributes
In order to allow to specify user alias on a policy basis, the user_alias
configuration has been renamed to default_user_alias
. This will affect test
suites setting config.user_alias
.
- Change
config.user_alias
toconfig.default_user_alias
The ambiguity of negated matchers has been eliminated, and this will affect
test suites using not_to
matchers.
The following matchers will raise an error because of their ambiguity and ask to switch to the opposite non-negated matcher:
not_to forbid_all_actions
not_to forbid_only_actions
not_to permit_all_actions
not_to permit_only_actions
The following matchers may fail, because there were ambiguous in the previous implementation, and the application policies should be fixed:
not_to forbid_edit_and_update_actions
not_to forbid_new_and_create_actions
not_to forbid_actions
(with multiple actions)not_to forbid_mass_assignment_of
(with multiple attributes)not_to permit_actions
(with multiple actions)not_to permit_edit_and_update_actions
not_to permit_new_and_create_actions
not_to permit_mass_assignment_of
(with multiple attributes)
- Add compatibility spec to assist with transitioning to more consistent
not_to
behaviour in the next major version of this gem. - Add more obvious warnings to the Readme regarding support for additional
arguments to
permit_action
andforbid_action
being removed.
- Error message improvements. Replace "allow" with "permit" in error messages.
- Ensure that policy actions are returned in a deterministic order.
- Move
forbid_action
matcher outside of class scope. - Improve code coverage in tests.
- Use modern default configuration for specs.
- Improvements to RuboCop config.
- Improvements to Readme examples.
- Introduce
permit_only_actions
andforbid_only_actions
matchers. - Readme improvements, with
permit_only_actions
being the recommended matcher. - Require multifactor authentication to publish gem.
- Enforce Ruby 3 in Gemfile (Ruby 2 support was dropped in the 2.0.0 release).
- Add rubocop-performance.
- Drop support for Ruby 2. Please upgrade your Rails application to use Ruby 3.
- Add support for Ruby 3 keyword arguments (
**kwargs
) for use withpermit_action
andforbid_action
. - Target Ruby 3 in GitHub Actions.
- Deprecate support for older versions of
rspec-rails
andpundit
in Readme. - Deprecate support for optional arguments to
permit_action
andforbid_action
.
- Fix attribute reader name used by
permit_all_actions
matcher. - Migrate from Travis CI to GitHub Actions (test and rubocop actions)
- Improve Rubocop configuration / fix offenses
- Add SimpleCov code coverage
- Update development dependencies
- Readme improvements
- Use
require_relative
to load new files so that they can be found from within the gem (was not applied in 1.8.2).
- Ensure that all files within the lib directory are loaded from the gem.
- No changes.
- Add back open-ended dependency on rspec-rails >= 3 (removed in v1.8.0).
- Add
permit_all_actions
andforbid_all_actions
matchers. - Add Contributor Covenant Code of Conduct.
- Move code repository to a new GitHub organisation.
- Update Ruby, Bundler, and gem versions used in development/test environments.
- Show a warning when
is_expected.not_to permit_actions
is attempted. - Allow a series of parameters to be passed to
permit_actions
andforbid_actions
- Allow
permit_mass_assignment_of
andforbid_mass_assignment_of
to accept an array of attributes for testing the mass assignment of multiple attributes.
- Remove configuration from being in a separate file (to get gem working again).
- Add support for configuring a custom user alias globally.
- Fix
permit_actions
andforbid_actions
matchers that were still not working with a singular action.
- Add a changelog going back to the 1.0.0 release.
- Remove requirement that
permit_actions
andforbid_actions
matchers check more than one action. - Add a list of which actions are mismatched to failure messages.
- Remove mention of
record
from error messages, since the record may be undefined.
- Add support for a second parameter in
permit_action
andforbid_action
matchers, containing arguments.
- Rollback the attempt to split matchers file into smaller files.
- Attempt to get split matchers file working inside of gem.
- Attempt to get split matchers file working inside of gem.
- Add RSpec to the project, along with specs for existing matchers.
- Add
permit_actions
andforbid_actions
matchers. - Prevent "instance variable not initialized" warnings from appearing in the test output.
- Attempt to split matchers file into smaller files.
- Add
for_action
matcher that can be chained tomass_assignment_of
matchers. - Change the word 'performing' to 'authorising' in failure messages.
- Fix
forbid_mass_assignment_of
matcher which was checking the opposite condition.
- Simplify gem dependencies to support RSpec 3.5 beta (and Rails 5).
- Require rspec/core explicitly.
- Initial stable release.