This repository has been archived by the owner on Jun 27, 2020. It is now read-only.
-
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
1 parent
1e96dd6
commit 48f4e8a
Showing
15 changed files
with
202 additions
and
60 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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module Ddr::Auth | ||
RSpec.describe Affiliation do | ||
|
||
describe "class methods" do | ||
describe ".all" do | ||
subject { described_class.all } | ||
it { is_expected.to eq([described_class::Faculty, described_class::Staff, described_class::Student, described_class::Emeritus, described_class::Affiliate, described_class::Alumni]) } | ||
end | ||
describe ".get" do | ||
subject { described_class.get("faculty") } | ||
it { is_expected.to eq(described_class::Faculty) } | ||
end | ||
describe ".group" do | ||
subject { described_class.group("faculty") } | ||
it { is_expected.to eq(described_class::Faculty.group) } | ||
end | ||
describe ".groups" do | ||
subject { described_class.groups } | ||
it { is_expected.to eq([described_class::Faculty.group, described_class::Staff.group, described_class::Student.group, described_class::Emeritus.group, described_class::Affiliate.group, described_class::Alumni.group]) } | ||
end | ||
end | ||
|
||
describe "constants" do | ||
describe "Faculty" do | ||
subject { described_class::Faculty } | ||
it { is_expected.to eq(described_class.get("faculty")) } | ||
end | ||
describe "Staff" do | ||
subject { described_class::Staff } | ||
it { is_expected.to eq(described_class.get("staff")) } | ||
end | ||
describe "Student" do | ||
subject { described_class::Student } | ||
it { is_expected.to eq(described_class.get("student")) } | ||
end | ||
describe "Affiliate" do | ||
subject { described_class::Affiliate } | ||
it { is_expected.to eq(described_class.get("affiliate")) } | ||
end | ||
describe "Emeritus" do | ||
subject { described_class::Emeritus } | ||
it { is_expected.to eq(described_class.get("emeritus")) } | ||
end | ||
describe "Alumni" do | ||
subject { described_class::Alumni } | ||
it { is_expected.to eq(described_class.get("alumni")) } | ||
end | ||
end | ||
|
||
describe "instance methods" do | ||
describe "#group" do | ||
subject { described_class::Faculty } | ||
it "should return the group for the affiliation" do | ||
expect(subject.group).to eq(Group.build("duke.faculty")) | ||
end | ||
end | ||
end | ||
|
||
end | ||
end |
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,5 +1,13 @@ | ||
module Ddr::Auth | ||
RSpec.describe Group, agents: true, groups: true do | ||
RSpec.describe Group do | ||
|
||
it { is_expected.to be_a(Agent) } | ||
|
||
describe "RDF type" do | ||
it "should be foaf:Group" do | ||
expect(subject.type.first).to eq(RDF::FOAF.Group) | ||
end | ||
end | ||
|
||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Ddr::Auth | ||
RSpec.describe Person do | ||
|
||
it { is_expected.to be_a(Agent) } | ||
|
||
describe "RDF type" do | ||
it "should be foaf:Person" do | ||
expect(subject.type.first).to eq(RDF::FOAF.Person) | ||
end | ||
end | ||
|
||
end | ||
end |
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
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
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
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
Oops, something went wrong.