Skip to content

Commit

Permalink
update mdtranslator branch; add valid and invalid controller tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rshewitt committed Nov 13, 2024
1 parent dffa052 commit 0436b79
Show file tree
Hide file tree
Showing 6 changed files with 1,670 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gem 'psych', '< 4.0.0'

gem 'adiwg-mdtranslator',
git: 'https://github.com/GSA/mdTranslator.git',
branch: 'datagov'
branch: 'master'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/GSA/mdTranslator.git
revision: fe10f1d66171757f87be54e3053e0c09821500b4
branch: datagov
revision: 95b5c77ed64700e21c2cf0fc48158c9259eba8cf
branch: master
specs:
adiwg-mdtranslator (2.20.0.pre.beta.5)
adiwg-mdcodes (= 2.10.0)
Expand Down
32 changes: 32 additions & 0 deletions test/controllers/translates_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,36 @@ class TranslatesControllerTest < ActionDispatch::IntegrationTest
as: :json
assert_response 422
end

test 'post valid transformation of iso19115_2_datagov to dcat_us' do
@translate = translates(:valid_iso19115_2_datagov_to_dcatus)
@file =
File.read(
File.join(File.dirname(__FILE__), "../fixtures/#{@translate.file}")
)
post '/translates',
params: {
file: @file,
reader: @translate.reader,
writer: @translate.writer
},
as: :json
assert_response 200
end

test 'post invalid transformation of iso19115_2_datagov to dcat_us' do
@translate = translates(:invalid_iso19115_2_datagov_to_dcatus)
@file =
File.read(
File.join(File.dirname(__FILE__), "../fixtures/#{@translate.file}")
)
post '/translates',
params: {
file: @file,
reader: @translate.reader,
writer: @translate.writer
},
as: :json
assert_response 422
end
end
Loading

0 comments on commit 0436b79

Please sign in to comment.