spec/lib/idy/extension/to_param_spec.rb in idy-0.1.3 vs spec/lib/idy/extension/to_param_spec.rb in idy-1.0.0
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
require 'rails_helper'
-RSpec.describe '.to_param' do
+RSpec.describe Clean, '.to_param' do
context 'when object does not acts as idy' do
subject { Clean.new id: 1 }
it 'behaves as default' do
expect(subject.to_param).to eq '1'
@@ -30,16 +30,16 @@
end
end
end
context 'when object is not persisted' do
- context 'and has no id' do
+ context 'when has no id' do
subject { Article.new }
specify { expect(subject.to_param).to be_nil }
end
- context 'and has id' do
+ context 'when has id' do
subject { Article.new id: 1 }
it 'generates a hash' do
expect(model_1.to_param).to eq 'My'
end