Skip to content

Commit

Permalink
Merge pull request #1332 from openjournals/fix-tests
Browse files Browse the repository at this point in the history
[WIP] Fix JCon Build
  • Loading branch information
xuanxu authored Apr 6, 2024
2 parents e265aaf + bdd85d2 commit 904a147
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/settings-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ logo_url: "http://proceedings.juliacon.org/logo_large.jpg"
url: "https://proceedings.juliacon.org"
editor_email: "admin@theoj.org"
noreply_email: "admin@theoj.org"
launch_date: "2019"
launch_date: "2019-06-01"
twitter: "@juliaconorg"
mastodon_url: "FIXME"
google_analytics: "UA-47852178-9"
Expand Down
2 changes: 1 addition & 1 deletion config/settings-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ logo_url: "http://proceedings.juliacon.org/logo_large.jpg"
url: "https://proceedings.juliacon.org"
editor_email: "juliacon@julialang.org"
noreply_email: "juliacon@julialang.org"
launch_date: "2019"
launch_date: "2019-06-01"
twitter: "@juliaconorg"
mastodon_url: "FIXME"
google_analytics: "UA-47852178-9"
Expand Down
2 changes: 1 addition & 1 deletion config/settings-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ logo_url: "http://proceedings.juliacon.org/logo_large.jpg"
url: "https://proceedings.juliacon.org"
editor_email: "admin@theoj.org"
noreply_email: "admin@theoj.org"
launch_date: "2019"
launch_date: "2019-06-01"
twitter: "@juliaconorg"
mastodon_url: "FIXME"
google_analytics: "UA-47852178-9"
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/home_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
it "should render home page" do
get :index, format: :html
expect(response).to be_successful
expect(response.body).to match /The Journal of Open Source Software/
expect(response.body).to match /Proceedings of the JuliaCon Conferences/
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/papers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
parsed_response = JSON.parse(response.body)
expect(parsed_response['submitted']).to eq(3.days.ago.strftime('%d %B %Y'))
expect(parsed_response['accepted']).to eq(2.days.ago.strftime('%d %B %Y'))
expect(parsed_response['doi']).to eq('10.21105/joss.00000')
expect(parsed_response['doi']).to eq('10.21105/jcon.00000')
end

it "should return paper's track short name" do
Expand Down Expand Up @@ -412,7 +412,7 @@
expect(parsed_response["submitting_author"]).to eq("@foobar")
expect(parsed_response["editor_name"]).to eq("Person McEditor")
expect(parsed_response["editor_orcid"]).to eq("0000-0000-0000-1234")
expect(parsed_response["doi"]).to eq("10.21105/joss.00000")
expect(parsed_response["doi"]).to eq("10.21105/jcon.00000")
expect(parsed_response["published_at"]).to_not be_nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/papers_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
state { 'retracted' }
accepted_at { Time.now }
review_issue_id { 0 }
sequence(:doi) {|n| "10.21105/jcon.00000#{n}" }
sequence(:doi) {|n| "10.21105/jcon.0000#{n}" }
end

factory :submitted_paper_with_sha do
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editor-pre-review-comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editor-review-comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-pre-review-comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-pre-review-opened.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-review-comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-review-edit.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"id": 52331602,
"node_id": "MDEwOlJlcG9zaXRvcnk1MjMzMTYwMg==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": false,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-review-labeled.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/editorialbot-review-opened.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"id": 59520368,
"node_id": "MDEwOlJlcG9zaXRvcnk1OTUyMDM2OA==",
"name": "joss-reviews-testing",
"full_name": "openjournals/joss-reviews-testing",
"full_name": "JuliaCon/proceedings-review",
"private": true,
"owner": {
"login": "openjournals",
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

it "returns false invitation is not created" do
expect(Octokit).to receive(:user).and_return(OpenStruct.new(id: 33))
expected_url = "https://api.github.com/orgs/openjournals/invitations"
expected_url = "https://api.github.com/orgs/JuliaCon/invitations"
expected_params = {invitee_id: 33, team_ids: [1234]}
exheaders = {"Authorization" => "token testGHtoken", "Content-Type" => "application/json", "Accept" => "application/vnd.github.v3+json"}
expect(Faraday).to receive(:post).with(expected_url, expected_params.to_json, exheaders).and_return(OpenStruct.new(status: 404))
Expand All @@ -64,7 +64,7 @@

it "returns true if invitation is created" do
expect(Octokit).to receive(:user).and_return(OpenStruct.new(id: 42))
expected_url = "https://api.github.com/orgs/openjournals/invitations"
expected_url = "https://api.github.com/orgs/JuliaCon/invitations"
expected_params = {invitee_id: 42, team_ids: [1234]}
exheaders = {"Authorization" => "token testGHtoken", "Content-Type" => "application/json", "Accept" => "application/vnd.github.v3+json"}
expect(Faraday).to receive(:post).with(expected_url, expected_params.to_json, exheaders).and_return(OpenStruct.new(status: 200))
Expand Down
10 changes: 5 additions & 5 deletions spec/models/paper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,17 @@
it "should know how to generate a PDF URL for Google Scholar" do
paper = create(:accepted_paper)

expect(paper.seo_url).to eq('http://joss.theoj.org/papers/10.21105/joss.00000')
expect(paper.seo_pdf_url).to eq('http://joss.theoj.org/papers/10.21105/joss.00000.pdf')
expect(paper.seo_url).to eq('https://proceedings.juliacon.org/papers/10.21105/jcon.00000')
expect(paper.seo_pdf_url).to eq('https://proceedings.juliacon.org/papers/10.21105/jcon.00000.pdf')
end
end

context "when not yet accepted" do
it "should know how to generate a PDF URL for Google Scholar" do
paper = create(:under_review_paper)

expect(paper.seo_url).to eq('http://joss.theoj.org/papers/48d24b0158528e85ac7706aecd8cddc4')
expect(paper.seo_pdf_url).to eq('http://joss.theoj.org/papers/48d24b0158528e85ac7706aecd8cddc4.pdf')
expect(paper.seo_url).to eq('https://proceedings.juliacon.org/papers/48d24b0158528e85ac7706aecd8cddc4')
expect(paper.seo_pdf_url).to eq('https://proceedings.juliacon.org/papers/48d24b0158528e85ac7706aecd8cddc4.pdf')
end
end

Expand Down Expand Up @@ -444,7 +444,7 @@
is_expected.to match /#{Rails.application.settings['reviewers_lookup_url']}/
end

it { is_expected.to match "Currently, there isn't a JOSS editor assigned" }
it { is_expected.to match "Currently, there isn't a JCON editor assigned" }
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/system/papers/show_published_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

feature "Published paper's show page" do
before do
@accepted_paper = create(:accepted_paper, title: "Astronomy paper", doi: "10.21105/joss.00001", review_issue_id: 1)
@accepted_paper = create(:accepted_paper, title: "Astronomy paper", doi: "10.21105/jcon.00001", review_issue_id: 1)
@accepted_paper.metadata['paper']['title'] = "Astronomy paper"
@accepted_paper.metadata['paper']['authors'] = [{'given_name' => "Vera", 'last_name' => "Rubin"}]
@accepted_paper.metadata['paper']['tags'] = ["Galaxy rotation curves"]
@accepted_paper.save!

@retracted_paper = create(:retracted_paper, title: "Bad paper", doi: "10.21105/joss.00002", review_issue_id: 2)
@retracted_paper = create(:retracted_paper, title: "Bad paper", doi: "10.21105/jcon.00002", review_issue_id: 2)
@retracted_paper.metadata['paper']['title'] = "Bad paper"
@retracted_paper.save!

@retraction_notice = create(:accepted_paper, title: "Retraction notice for: Bad paper", doi: "10.21105/joss.00002R")
@retraction_notice = create(:accepted_paper, title: "Retraction notice for: Bad paper", doi: "10.21105/jcon.00002R")
@retraction_notice.update(retracted_paper: @retracted_paper)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/views/papers/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
render template: "papers/show", formats: :html

# Paper metadata
expect(rendered).to have_title("The Journal of Open Source Software: #{paper.scholar_title}")
expect(rendered).to have_title("Proceedings of the JuliaCon Conferences: #{paper.scholar_title}")

expect(rendered).to have_css("meta[name='citation_title']", visible: false)
expect(rendered).to have_css("meta[content='#{paper.scholar_title}']", visible: false)
Expand Down

0 comments on commit 904a147

Please sign in to comment.