adapt version filter spec

pull/8205/head
ulferts 5 years ago
parent 125d51c2b8
commit 185a4058f7
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 16
      spec/models/queries/work_packages/filter/version_filter_spec.rb

@ -40,12 +40,12 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
before do
if project
allow(project)
.to receive_message_chain(:shared_versions, :order_by_semver_name)
.and_return [version]
.to receive_message_chain(:shared_versions, :pluck)
.and_return [version.id]
else
allow(Version)
.to receive_message_chain(:visible, :systemwide, :order_by_semver_name)
.and_return [version]
.to receive_message_chain(:visible, :systemwide, :pluck)
.and_return [version.id]
end
end
@ -57,7 +57,7 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
it 'is false if the value does not exist as a version' do
allow(project)
.to receive_message_chain(:shared_versions, :order_by_semver_name)
.to receive_message_chain(:shared_versions, :pluck)
.and_return []
expect(instance).to_not be_valid
@ -73,7 +73,7 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
it 'is false if the value does not exist as a version' do
allow(Version)
.to receive_message_chain(:visible, :systemwide, :order_by_semver_name)
.to receive_message_chain(:visible, :systemwide, :pluck)
.and_return []
expect(instance).to_not be_valid
@ -85,7 +85,7 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
context 'within a project' do
before do
expect(instance.allowed_values)
.to match_array [[version.name, version.id.to_s]]
.to match_array [[version.id.to_s, version.id.to_s]]
end
end
@ -94,7 +94,7 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
before do
expect(instance.allowed_values)
.to match_array [[version.name, version.id.to_s]]
.to match_array [[version.id.to_s, version.id.to_s]]
end
end
end

Loading…
Cancel
Save