Sha256: 80e8eeb905194138056b308d665b8dde70ee2af05fb0b21c09f950aad2192a71

Contents?: true

Size: 991 Bytes

Versions: 2

Compression:

Stored size: 991 Bytes

Contents

require 'spec_helper'
require 'genomer-plugin-validate/validator/view_attributes'

describe GenomerPluginValidate::Validator::ViewAttributes do

  subject{ described_class }

  describe "where there are no annotations" do
    it{ should return_no_errors_for [] }
  end

  describe "where there are capitalized attribute keys" do
    attns = [annotation({:attributes => {'Unknown_term' => 'something'}})]
    it{ should return_no_errors_for attns}
  end

  describe "where there are valid view attributes" do
    attrs = %w|product ec_number function feature_type|
    attrs.each do |attr|
      attns = [annotation({:attributes => {attr => 'something'}})]
      it{ should return_no_errors_for attns}
    end
  end

  describe "where there is an unknown lower case attribute key" do
    attns =  [annotation({:attributes => {'unknown_term' => 'something','ID' => 1}})]
    errors = ["Illegal view attribute 'unknown_term' for '1'"]
    it{ should return_errors_for attns, errors}
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
genomer-plugin-validate-0.0.2 spec/genomer-plugin-validate/validator/view_attributes_spec.rb
genomer-plugin-validate-0.0.1 spec/genomer-plugin-validate/validator/view_attributes_spec.rb