Skip to content

Commit

Permalink
fix rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
iTakeshi committed May 24, 2015
1 parent 0a54c68 commit 7e6b390
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/requests/api/document_files_spec.rb
Expand Up @@ -45,7 +45,7 @@

describe "POST /api/document_files" do
before do
@filepath = File.join(Rails.root, "misc", "uploaded", "000002-dummy.pdf")
@filepath = File.join(Rails.root, "misc", "uploaded", "000002-ダミー.pdf")
@json_params = {
subject_id: 1,
class_year: 93,
Expand All @@ -66,7 +66,7 @@
expect(response.status).to eq(201)
expect(DocumentFile.count).to eq(old_size + 1)
df_id = json["id"]
expect(File.binread("/tmp/#{sprintf("%06d", df_id)}-000002-dummy.pdf")).to eq(File.binread(@filepath))
expect(File.binread("/tmp/#{sprintf("%06d", df_id)}-000002-ダミー.pdf")).to eq(File.binread(@filepath))
end

it "returns 422 if uploaded file is missing" do
Expand Down Expand Up @@ -108,7 +108,7 @@

describe "PATCH /api/document_files/1" do
before do
@filepath = File.join(Rails.root, "misc", "uploaded", "000002-dummy.pdf")
@filepath = File.join(Rails.root, "misc", "uploaded", "000002-ダミー.pdf")
@json_params = {
subject_id: 2,
class_year: 93,
Expand Down Expand Up @@ -146,9 +146,9 @@
file: fixture_file_upload(@filepath, "application/pdf")
)
expect(response.status).to eq(200)
expect(response.file_name).to eq("000002-dummy.pdf")
expect(response.file_name).to eq("000002-ダミー.pdf")
df_id = json["id"]
expect(File.binread("/tmp/#{sprintf("%06d", df_id)}-000002-dummy.pdf")).to eq(File.binread(@filepath))
expect(File.binread("/tmp/#{sprintf("%06d", df_id)}-000002-ダミー.pdf")).to eq(File.binread(@filepath))
end

it "returns 401 to an unauthorized client" do
Expand Down

0 comments on commit 7e6b390

Please sign in to comment.