OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use be_writable instead of writable? in specs
Dombi Attilaf72699403d76
diff --git a/modules/backlogs/spec/api/work_packages/schema/specific_work_package_schema_spec.rb b/modules/backlogs/spec/api/work_packages/schema/specific_work_package_schema_spec.rbindex f72f040147b..8dfd6d4a0d4 100644--- a/modules/backlogs/spec/api/work_packages/schema/specific_work_package_schema_spec.rb+++ b/modules/backlogs/spec/api/work_packages/schema/specific_work_package_schema_spec.rb@@ -53,7 +53,11 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit "is #{'not' unless writable} writable" do- expect(subject.writable?(:version)).to eql(writable)+ if writable+ expect(subject).to be_writable(:version)+ else+ expect(subject).not_to be_writable(:version)+ endendend@@ -66,7 +70,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit "is writable" do- expect(subject.writable?(:version)).to be(true)+ expect(subject).to be_writable(:version)endend@@ -83,7 +87,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit 'is writable' do- expect(subject.writable?(:remaining_hours)).to be(true)+ expect(subject).to be_writable(:remaining_hours)endend@@ -93,7 +97,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit 'is not writable' do- expect(subject.writable?(:remaining_hours)).to be(false)+ expect(subject).not_to be_writable(:remaining_hours)endendenddiff --git a/modules/dashboards/spec/lib/dashboards/grid_registration_spec.rb b/modules/dashboards/spec/lib/dashboards/grid_registration_spec.rbindex abf309bfb8b..016c02c0550 100644--- a/modules/dashboards/spec/lib/dashboards/grid_registration_spec.rb+++ b/modules/dashboards/spec/lib/dashboards/grid_registration_spec.rb@@ -66,8 +66,8 @@ describe Dashboards::GridRegistration docontext 'if the user has the :manage_dashboards permission' doit 'is truthy' do- expect(described_class.writable?(grid, user))- .to be_truthy+ expect(described_class)+ .to be_writable(grid, user)endend@@ -75,8 +75,8 @@ describe Dashboards::GridRegistration dolet(:allowed) { false }it 'is falsey' do- expect(described_class.writable?(grid, user))- .to be_falsey+ expect(described_class)+ .not_to be_writable(grid, user)endendenddiff --git a/spec/constants/settings/definition_spec.rb b/spec/constants/settings/definition_spec.rbindex f7facd7012d..06e1dc99235 100644--- a/spec/constants/settings/definition_spec.rb+++ b/spec/constants/settings/definition_spec.rb@@ -909,8 +909,8 @@ describe Settings::Definition doendit 'returns the procs return value for writable' do- expect(instance.writable?)- .to be false+ expect(instance)+ .not_to be_writableendit 'returns the procs return value for allowed' dodiff --git a/spec/lib/api/v3/work_packages/schema/specific_work_package_schema_spec.rb b/spec/lib/api/v3/work_packages/schema/specific_work_package_schema_spec.rbindex c4c69bfffda..05b5b97e4e0 100644--- a/spec/lib/api/v3/work_packages/schema/specific_work_package_schema_spec.rb+++ b/spec/lib/api/v3/work_packages/schema/specific_work_package_schema_spec.rb@@ -176,46 +176,46 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema docontext 'percentage done' doit 'is not writable when inferred by status' doallow(Setting).to receive(:work_package_done_ratio).and_return('status')- expect(subject.writable?('done_ratio')).to be false+ expect(subject).not_to be_writable(:done_ratio)endit 'is not writable when disabled' doallow(Setting).to receive(:work_package_done_ratio).and_return('disabled')- expect(subject.writable?('done_ratio')).to be false+ expect(subject).not_to be_writable(:done_ratio)endit 'is not writable when the work package is a parent' doallow(work_package).to receive(:leaf?).and_return(false)- expect(subject.writable?('done_ratio')).to be false+ expect(subject).not_to be_writable(:done_ratio)endit 'is writable when the work package is a leaf' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('done_ratio')).to be true+ expect(subject).to be_writable('done_ratio')endendcontext 'estimated time' doit 'is writable when the work package is a parent' doallow(work_package).to receive(:leaf?).and_return(false)- expect(subject.writable?('estimated_hours')).to be true+ expect(subject).to be_writable(:estimated_hours)endit 'is writable when the work package is a leaf' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('estimated_hours')).to be true+ expect(subject).to be_writable(:estimated_hours)endendcontext 'derived estimated time' doit 'is not writable when the work package is a parent' doallow(work_package).to receive(:leaf?).and_return(false)- expect(subject.writable?('derived_estimated_time')).to be false+ expect(subject).not_to be_writable(:derived_estimated_time)endit 'is not writable when the work package is a leaf' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('derived_estimated_time')).to be false+ expect(subject).not_to be_writable(:derived_estimated_time)endend@@ -229,7 +229,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema docontext 'scheduled automatically' doit 'is not writable' do- expect(subject.writable?('start_date')).to be false+ expect(subject).not_to be_writable(:start_date)endend@@ -239,7 +239,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit 'is writable' do- expect(subject.writable?('start_date')).to be true+ expect(subject).to be_writable(:start_date)endendend@@ -247,7 +247,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema docontext 'work package is a leaf' doit 'is writable' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('start_date')).to be true+ expect(subject).to be_writable(:start_date)endendend@@ -262,7 +262,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema docontext 'scheduled automatically' doit 'is not writable' do- expect(subject.writable?('due_date')).to be false+ expect(subject).not_to be_writable(:due_date)endend@@ -272,7 +272,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doendit 'is writable' do- expect(subject.writable?('due_date')).to be true+ expect(subject).to be_writable(:due_date)endendend@@ -280,7 +280,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema docontext 'work package is a leaf' doit 'is writable' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('due_date')).to be true+ expect(subject).to be_writable(:due_date)endendend@@ -294,24 +294,24 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema doit 'is not writable when the work package is a parent' doallow(work_package).to receive(:leaf?).and_return(false)- expect(subject.writable?('date')).to be false+ expect(subject).not_to be_writable(:date)endit 'is writable when the work package is a leaf' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('date')).to be true+ expect(subject).to be_writable(:date)endendcontext 'priority' doit 'is writable when the work package is a parent' doallow(work_package).to receive(:leaf?).and_return(false)- expect(subject.writable?('priority')).to be true+ expect(subject).to be_writable(:priority)endit 'is writable when the work package is a leaf' doallow(work_package).to receive(:leaf?).and_return(true)- expect(subject.writable?('priority')).to be true+ expect(subject).to be_writable(:priority)endendenddiff --git a/spec/lib/api/v3/work_packages/schema/typed_work_package_schema_spec.rb b/spec/lib/api/v3/work_packages/schema/typed_work_package_schema_spec.rbindex 1d48815ede8..5c1a94f59b5 100644--- a/spec/lib/api/v3/work_packages/schema/typed_work_package_schema_spec.rb+++ b/spec/lib/api/v3/work_packages/schema/typed_work_package_schema_spec.rb@@ -64,19 +64,19 @@ describe ::API::V3::WorkPackages::Schema::TypedWorkPackageSchema dodescribe '#writable?' doit 'percentage done is writable' do- expect(subject.writable?(:done_ratio)).to be true+ expect(subject).to be_writable(:done_ratio)endit 'estimated time is writable' do- expect(subject.writable?(:estimated_hours)).to be true+ expect(subject).to be_writable(:estimated_hours)endit 'start date is writable' do- expect(subject.writable?(:start_date)).to be true+ expect(subject).to be_writable(:start_date)endit 'finish date is writable' do- expect(subject.writable?(:due_date)).to be true+ expect(subject).to be_writable(:due_date)endend@@ -98,7 +98,7 @@ describe ::API::V3::WorkPackages::Schema::TypedWorkPackageSchema doendit 'has a writable date' do- expect(subject.writable?(:date)).to be true+ expect(subject).to be_writable(:date)endend