Skip to content

Commit

Permalink
correcting the rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
alexBLR committed Apr 26, 2017
1 parent f48344a commit f79df79
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 41 deletions.
44 changes: 22 additions & 22 deletions spec/factories/collection.rb
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
FactoryGirl.define do
factory :collection do
transient do
user { FactoryGirl.create(:user) }
end
sequence(:title) { |n| ["Title #{n}"] }
transient do
user { FactoryGirl.create(:user) }
end
sequence(:title) { |n| ["Title #{n}"] }

after(:build) do |work, evaluator|
work.apply_depositor_metadata(evaluator.user.user_key)
end
after(:build) do |work, evaluator|
work.apply_depositor_metadata(evaluator.user.user_key)
end

factory :public_collection, traits: [:public]
factory :public_collection, traits: [:public]

trait :public do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
end
trait :public do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
end

factory :private_collection do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
end
factory :private_collection do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
end

factory :institution_collection do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
end
factory :institution_collection do
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
end

factory :named_collection do
title ['collection title']
description ['collection description']
end
factory :named_collection do
title ['collection title']
description ['collection description']
end
end
end
end
4 changes: 2 additions & 2 deletions spec/factories/etd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
factory :etd do
title ['China and its Minority Population']
creator ['Eun, Dongwon']
keyword ['China' 'Minority Population']
keyword ['China', 'Minority Population']
degree ['Bachelor of Arts with Honors']
department ['Department of Russian and East Asian Languages and Cultures']
school ['Emory College of Arts and Sciences']
visibility Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
end
end
end
3 changes: 1 addition & 2 deletions spec/factories/file_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,5 @@
title ["Fake Wav File.wav"]
subject %w[sed do eiusmod tempor incididunt ut labore]
end

end
end
end
17 changes: 8 additions & 9 deletions spec/factories/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
factory :user do
sequence(:email) { |n| "user#{n}@example.com" }
password "12345678"
password_confirmation "12345678"
transient do
password_confirmation "12345678"

transient do
# Allow for custom groups when a user is instantiated.
# @example FactoryGirl.create(:user, groups: 'admin')
groups []
end

factory :admin do
groups ['admin']
end
end

trait :guest do
guest true
end
trait :guest do
guest true
end
end

end
end
2 changes: 1 addition & 1 deletion spec/features/create_etd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

RSpec.feature 'Create a Etd' do
context 'a logged in user' do
let(:user) { create :user }
let(:user) { create :user }

before do
login_as user
Expand Down
4 changes: 2 additions & 2 deletions spec/features/search_etd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rails_helper'

RSpec.feature 'Search for an ETD' do
let(:etd) { build :etd }
let(:etd) { build :etd }

context 'a logged in user' do
let(:user) { create :user }
let(:user) { create :user }

before do
login_as user
Expand Down
4 changes: 2 additions & 2 deletions spec/features/show_etd_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rails_helper'

RSpec.feature 'Display an ETD' do
let(:etd) { build :etd }
let(:etd) { build :etd }

context 'a logged in user' do
let(:user) { create :user }
let(:user) { create :user }

before do
login_as user
Expand Down
2 changes: 1 addition & 1 deletion spec/support/factory_girl.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# spec/support/factory_girl.rb
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
end

0 comments on commit f79df79

Please sign in to comment.