• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / orcid_princeton_hanami / 7bbed874-efa4-4a46-80ba-e88be274748f

25 Jun 2025 08:14PM UTC coverage: 88.055% (-8.4%) from 96.46%
7bbed874-efa4-4a46-80ba-e88be274748f

Pull #6

circleci

carolyncole
Adding system tests from rails app
Converted FactoryBot to ROM::Factory
Remmoved Rails refrences
Set all tests to pending becuase the screens they are testing do not exists
Pull Request #6: Adding system tests from rails app

80 of 134 new or added lines in 7 files covered. (59.7%)

516 of 586 relevant lines covered (88.05%)

1.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.04
/spec/system/user_show_spec.rb
1
# frozen_string_literal: true
2
require "spec_helper"
1✔
3

4
RSpec.describe "user show screen", type: :system, js: true do
1✔
5
  context "with a fully populated account" do
1✔
6
    let(:user) { Factory[:user_with_orcid_and_token] }
4✔
7

8
    before do
1✔
9
      pending "We have a user model"
3✔
10
      stub_request(:get, "https://api.sandbox.orcid.org/v3.0/#{user.orcid}/record")
3✔
11
        .with(
12
        headers: {
13
          "Accept" => "application/json",
14
          "Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
15
          "Authorization" => "Bearer #{user.tokens.first.token}",
16
          "User-Agent" => "Ruby"
17
        }
18
      )
19
        .to_return(status: 401, body: "", headers: {}) # HTTP 401 means the token is not valid anymore
20
    end
21

22
    it "shows the user's account information" do
1✔
NEW
23
      login_as user
×
NEW
24
      visit "/users/#{user.id}"
×
NEW
25
      expect(page).to have_content("https://orcid.org/#{user.orcid}")
×
26
    end
27

28
    it "it allows a user to revoke linking to ORCiD" do
1✔
NEW
29
      login_as user
×
NEW
30
      visit "/users/#{user.id}"
×
31
      # user has linked their account to ORCiD
NEW
32
      expect(page).to have_content("https://orcid.org/#{user.orcid}")
×
NEW
33
      click_on "Check Authentication to ORCiD"
×
34
      # account is not linked anymore
NEW
35
      expect(page).to have_content("Connect your ORCID iD")
×
36
    end
37

38
    it "shows the faq sections" do
1✔
NEW
39
      login_as user
×
NEW
40
      visit "/users/#{user.id}"
×
41
      # user has linked their account to ORCiD
NEW
42
      expect(page).to have_content("https://orcid.org/#{user.orcid}")
×
NEW
43
      expect(page).not_to have_content("You can quickly and easily remove your duplicate account")
×
NEW
44
      click_on "What do I do if I have more than one ORCID iD?"
×
NEW
45
      expect(page).to have_content("You can quickly and easily remove your duplicate account")
×
NEW
46
      expect(page).not_to have_content("For other federal grantmaking agencies")
×
NEW
47
      click_on "Are Federal Agencies requiring ORCID?"
×
NEW
48
      expect(page).to have_content("For other federal grantmaking agencies")
×
49
    end
50
  end
51
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc