Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
7e3fdb7e
Commit
7e3fdb7e
authored
2 years ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Completed attributes row rspec
parent
2b8244d1
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!19
Develop
,
!4
Customise dataset show page
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hyrax/spec/factories/dataset.rb
+4
-0
4 additions, 0 deletions
hyrax/spec/factories/dataset.rb
hyrax/spec/views/hyrax/datasets/_attribute_rows.html_spec.rb
+17
-7
17 additions, 7 deletions
hyrax/spec/views/hyrax/datasets/_attribute_rows.html_spec.rb
with
21 additions
and
7 deletions
hyrax/spec/factories/dataset.rb
+
4
−
0
View file @
7e3fdb7e
...
...
@@ -83,6 +83,10 @@ FactoryBot.define do
source
{
[
'Source-123'
]
}
end
trait
:with_doi
do
doi
{
"1234-1567"
}
end
trait
:with_complex_person
do
complex_person_attributes
{
[{
...
...
This diff is collapsed.
Click to expand it.
hyrax/spec/views/hyrax/datasets/_attribute_rows.html_spec.rb
+
17
−
7
View file @
7e3fdb7e
...
...
@@ -4,8 +4,8 @@ include Warden::Test::Helpers
RSpec
.
describe
'hyrax/datasets/_attribute_rows'
do
user
=
User
.
find_by
(
email:
'admin@hyrax'
)
let
(
:partial
)
{
'hyrax/datasets/attribute_rows'
}
let
(
:dataset
)
{
create
(
:dataset
,
:open
,
:with_
alternative_title
,
:with_complex_person
,
:with_
keyword
,
:with_subject
,
:with_publisher
,
:with_complex_identifier
,
:with_
resource_typ
e
,
:with_complex_relation
)
}
let
(
:dataset
)
{
create
(
:dataset
,
:open
,
:with_
doi
,
:with_complex_person
,
:with_
complex_date
,
:with_
complex_identifier
,
:with_complex_funding_referenc
e
,
:with_complex_relation
)
}
let
(
:presenter
)
{
Hyrax
::
DatasetPresenter
.
new
(
SolrDocument
.
new
(
dataset
.
to_solr
),
Ability
.
new
(
user
),
controller
.
request
)
}
before
do
...
...
@@ -19,15 +19,25 @@ RSpec.describe 'hyrax/datasets/_attribute_rows' do
context
'authenticated user'
do
it
'shows the correct metadata'
do
expect
(
rendered
).
to
have_content
(
'Alternative-Title-123'
)
# doi
expect
(
rendered
).
to
have_content
(
'1234-1567'
)
# complex person
expect
(
rendered
).
to
have_content
(
'Anamika'
)
expect
(
rendered
).
to
have_content
(
'operator'
)
expect
(
rendered
).
to
have_content
(
'University'
)
expect
(
rendered
).
to
have_content
(
'Keyword-123'
)
expect
(
rendered
).
to
have_content
(
'Subject-123'
)
# complex identifier
expect
(
rendered
).
to
have_content
(
'doi:10.0.1111'
)
expect
(
rendered
).
to
have_content
(
'Resource-Type-123'
)
# complex relation
expect
(
rendered
).
to
have_content
(
'A relation label'
)
expect
(
rendered
).
not_to
have_content
(
'Abstract-Description-123'
)
# Abstract/Description is not displayed in this table partial
expect
(
rendered
).
to
have_content
(
'is new version of'
)
# complex funder reference
expect
(
rendered
).
to
have_content
(
'f1234'
)
expect
(
rendered
).
to
have_content
(
'Bank'
)
expect
(
rendered
).
to
have_content
(
'a1234'
)
expect
(
rendered
).
to
have_content
(
'http://example.com/a1234'
)
expect
(
rendered
).
to
have_content
(
'No free lunch'
)
# Abstract/Description is not displayed in this table partial
expect
(
rendered
).
not_to
have_content
(
'Abstract-Description-123'
)
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment