Skip to content

Commit

Permalink
Fix rake spec that I mucked up while cherry-picking
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo committed Sep 7, 2017
1 parent 8ad34bf commit 78507ae
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions spec/tasks/rake_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
require 'rake'

describe "Rake tasks" do
before do
load_rake_environment [
File.expand_path("../../../tasks/sufia_user.rake", __FILE__),
File.expand_path("../../../lib/tasks/default_admin_set.rake", __FILE__)
]
end

describe "sufia:user:list_emails" do
let!(:user1) { FactoryGirl.create(:user) }
let!(:user2) { FactoryGirl.create(:user) }

before do
load_rake_environment [
File.expand_path("../../../tasks/sufia_user.rake", __FILE__),
File.expand_path("../../../lib/tasks/default_admin_set.rake", __FILE__)
]
end

it "creates a file" do
run_task "sufia:user:list_emails"
expect(File.exist?("user_emails.txt")).to be_truthy
Expand All @@ -26,15 +26,15 @@
expect(IO.read("abc123.txt")).to include(user1.email, user2.email)
File.delete("abc123.txt")
end
end

describe 'sufia:default_admin_set:create' do
before do
AdminSet.find(AdminSet::DEFAULT_ID).eradicate if AdminSet.exists?(AdminSet::DEFAULT_ID)
end
describe 'sufia:default_admin_set:create' do
before do
AdminSet.find(AdminSet::DEFAULT_ID).eradicate if AdminSet.exists?(AdminSet::DEFAULT_ID)
end

it 'creates the default AdminSet' do
expect { run_task 'sufia:default_admin_set:create' }.to change { AdminSet.count }.by(1)
end
it 'creates the default AdminSet' do
expect { run_task 'sufia:default_admin_set:create' }.to change { AdminSet.count }.by(1)
end
end
end

0 comments on commit 78507ae

Please sign in to comment.