Skip to content

Commit

Permalink
use periodical instead of serial. datacite/datacite#793
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 27, 2019
1 parent 18e34e8 commit 8f60bea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Client < ActiveRecord::Base
validates_uniqueness_of :symbol, message: "This Client ID has already been taken"
validates_format_of :contact_email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
validates_inclusion_of :role_name, :in => %w( ROLE_DATACENTRE ), :message => "Role %s is not included in the list"
validates_inclusion_of :client_type, :in => %w( repository serial other ), :message => "Client type %s is not included in the list", if: :client_type?
validates_inclusion_of :client_type, :in => %w( repository periodical other ), :message => "Client type %s is not included in the list", if: :client_type?
validates_associated :provider
validate :check_id, :on => :create
validate :freeze_symbol, :on => :update
Expand Down
8 changes: 8 additions & 0 deletions spec/requests/clients_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@

relationships = json.dig('data', 'relationships')
expect(relationships.dig("provider", "data", "id")).to eq(provider.symbol.downcase)

Client.import
sleep 1

get '/clients', nil, headers

expect(json['data'].size).to eq(2)
expect(json.dig('meta', 'clientTypes')).to eq([{"count"=>1, "id"=>"repository", "title"=>"Repository"}])
end
end

Expand Down

0 comments on commit 8f60bea

Please sign in to comment.