Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 21, 2020
1 parent 3cb8c87 commit 6e4cc12
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 11 deletions.
27 changes: 16 additions & 11 deletions spec/concerns/helpable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,24 @@
end
end

# it 'should register on save' do
# url = "https://blog.datacite.org/"
# subject = create(:doi, doi: "10.5438/hpc4-5t22", url: url, client: client, aasm_state: "findable")
it 'should register on save' do
url = "https://blog.datacite.org/"
subject = create(:doi, doi: "10.4124/shxthpwryv", url: url, client: client, aasm_state: "findable")

# expect(subject.url).to eq(url)
# expect(subject.minted.iso8601).to be_present

# sleep 1
# response = subject.get_url
expect(subject.url).to eq(url)
expect(subject.minted.iso8601).to be_present

# expect(response.body.dig("data", "responseCode")).to eq(1)
# expect(response.body.dig("data", "values")).to eq([{"index"=>1, "type"=>"URL", "data"=>{"format"=>"string", "value"=>"https://blog.datacite.org/"}, "ttl"=>86400, "timestamp"=>"2018-07-24T10:43:28Z"}])
# end
sleep 1
response = subject.get_url
expect(response.body.dig("data", "responseCode")).to eq(1)
expect(response.body.dig("data", "values")).to eq([{"data"=>
{"format"=>"string",
"value"=>"https://staging-data.mendeley.com/datasets/shxthpwryv"},
"index"=>1,
"timestamp"=>"2020-05-21T08:56:38Z",
"ttl"=>86400,
"type"=>"URL"}])
end

it 'should change url' do
subject.url = "https://blog.datacite.org/re3data-science-europe/"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e4cc12

Please sign in to comment.