Sha256: a30cfe6d7291e87230a7ac4ba1dcccd12440be3bdcef7e0646936e5504cc2e7c

Contents?: true

Size: 540 Bytes

Versions: 3

Compression:

Stored size: 540 Bytes

Contents

describe 'GitOperation' do
  before do
    GitOperation.auto_migrate!

    @operation = GitOperation.new
  end

end

shared_examples 'unnamed SCM operation' do
  before do
    @operation.name = nil
    @operation.valid?
  end

  it 'is not valid' do
    expect(@operation).not_to be_valid
  end

  it 'is not valid in default validation context' do
    expect(@operation).not_to be_valid(:default)
  end

  it 'points to blank name in the error message' do
    expect(@operation.errors.on(:name)).to eq ['Name must not be blank']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sbf-dm-validations-1.4.0 spec/integration/required_field_validator/shared_examples.rb
sbf-dm-validations-1.3.0 spec/integration/required_field_validator/shared_examples.rb
sbf-dm-validations-1.3.0.beta spec/integration/required_field_validator/shared_examples.rb