-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
class TranslatesControllerTest < ActionDispatch::IntegrationTest | ||
setup do | ||
@translate = translates(:one) | ||
end | ||
|
||
test "should get index" do | ||
get translates_url, as: :json | ||
assert_response :success | ||
end | ||
|
||
test "should create translate" do | ||
assert_difference('Translate.count') do | ||
post translates_url, params: { translate: { format: @translate.format, reader: @translate.reader, writer: @translate.writer } }, as: :json | ||
end | ||
|
||
assert_response 201 | ||
end | ||
|
||
test "should show translate" do | ||
get translate_url(@translate), as: :json | ||
assert_response :success | ||
end | ||
|
||
test "should update translate" do | ||
patch translate_url(@translate), params: { translate: { format: @translate.format, reader: @translate.reader, writer: @translate.writer } }, as: :json | ||
test 'post transformation of fgdc to iso19115_3' do | ||
@translate = translates(:fgdc_to_iso) | ||
@file = File.read(File.expand_path("../../fixtures/#{@translate.file}", __FILE__)) | ||
post '/translates', params: { translate: { file: @file, | ||
reader: @translate.reader, writer: @translate.writer } }, as: :json | ||
assert_response 200 | ||
end | ||
|
||
test "should destroy translate" do | ||
assert_difference('Translate.count', -1) do | ||
delete translate_url(@translate), as: :json | ||
end | ||
|
||
assert_response 204 | ||
end | ||
end |