Skip to content

Commit

Permalink
Back to standard tests with no auth
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed May 19, 2015
1 parent 568cfd8 commit 25da655
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
matrix:
- MONGODB=2.4.12
- MONGODB=2.6.7
- MONGODB=3.0.0-rc8
- MONGODB=3.0.3

before_script:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz -O /tmp/mongodb.tgz
Expand Down
2 changes: 0 additions & 2 deletions spec/config/mongoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ test:
hosts:
- <%=ENV["MONGOID_SPEC_HOST"]%>:<%=ENV["MONGOID_SPEC_PORT"]%>
options:
user: "mongoid-test-user"
password: "password"
read:
mode: primary
options:
Expand Down
8 changes: 4 additions & 4 deletions spec/mongoid/criteria_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ class D
end
end

pending "does not eager load the last document" do
it "does not eager load the last document" do
doc = criteria.last
expect_query(1) do
expect(doc.person).to eq(person_two)
Expand Down Expand Up @@ -1429,7 +1429,7 @@ class D
end
end

pending "does not eager load the first document" do
it "does not eager load the first document" do
doc = criteria.first
expect_query(1) do
expect(doc.person).to eq(person)
Expand Down Expand Up @@ -1491,7 +1491,7 @@ class D
end
end

pending "does not eager load the last document" do
it "does not eager load the last document" do
doc = criteria.last
expect_query(1) do
expect(doc.band).to eq(tool)
Expand Down Expand Up @@ -1523,7 +1523,7 @@ class D
end
end

pending "does not eager load the first document" do
it "does not eager load the first document" do
doc = criteria.first
expect_query(1) do
expect(doc.band).to eq(depeche)
Expand Down
42 changes: 1 addition & 41 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def database_id_alt
"mongoid_test_alt"
end

require 'support/authorization'
require 'support/expectations'

# Give MongoDB time to start up on the travis ci environment.
Expand All @@ -64,9 +63,7 @@ def database_id_alt
hosts: [ "#{HOST}:#{PORT}" ],
options: {
server_selection_timeout: 0.5,
max_pool_size: 1,
user: MONGOID_TEST_USER.name,
password: MONGOID_TEST_USER.password
max_pool_size: 1
}
}
}
Expand Down Expand Up @@ -115,43 +112,6 @@ class Application < Rails::Application
RSpec.configure do |config|
config.raise_errors_for_deprecations!
config.include(Mongoid::Expectations)

config.before(:suite) do
client = Mongo::Client.new(["#{HOST}:#{PORT}"])
begin
# Create the root user administrator as the first user to be added to the
# database. This user will need to be authenticated in order to add any
# more users to any other databases.
client.database.users.create(MONGOID_ROOT_USER)
rescue Exception => e
end
begin
# Adds the test user to the test database with permissions on all
# databases that will be used in the test suite.
client.with(
user: MONGOID_ROOT_USER.name,
password: MONGOID_ROOT_USER.password
).database.users.create(MONGOID_TEST_USER)
rescue Exception => e
# If we are on versions less than 2.6, we need to create a user for
# each database, since the users are not stored in the admin database
# but in the system.users collection on the datbases themselves. Also,
# roles in versions lower than 2.6 can only be strings, not hashes.
unless client.cluster.servers.first.features.write_command_enabled?
begin
client.with(
user: MONGOID_ROOT_USER.name,
password: MONGOID_ROOT_USER.password,
auth_source: Mongo::Database::ADMIN,
database: database_id
).database.users.create(MONGOID_LEGACY_TEST_USER)
rescue Exception => e
end
end
end
end

# Drop all collections and clear the identity map before each spec.
config.before(:each) do
Mongoid.purge!
end
Expand Down
37 changes: 0 additions & 37 deletions spec/support/authorization.rb

This file was deleted.

0 comments on commit 25da655

Please sign in to comment.