Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Conditionnal spec

  • Loading branch information...
commit 0b5fd2520114b21851cc0d944bfeebcfb22e1a4f 1 parent ebba67a
@apneadiving apneadiving authored
View
6 .travis.yml
@@ -3,12 +3,6 @@ rvm:
- 1.8.7
- 1.9.2
- 1.9.3
-gemfile:
- - gemfiles/Mongoid-2-4.gemfile
- - gemfiles/Mongoid-3-0.gemfile
- - gemfiles/Rails-3-0.gemfile
- - gemfiles/Rails-3-1.gemfile
- - gemfiles/Rails-3-2.gemfile
before_script: 'cd spec/dummy/; rake db:migrate RAILS_ENV=test; cd ../..'
script: 'rspec spec'
View
5 gemfiles/Mongoid-2-4.gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "mongoid", "~> 2.4.0"
-
-gemspec :path=>"../"
View
5 gemfiles/Mongoid-3-0.gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "mongoid", "~> 3.0.0"
-
-gemspec :path=>"../"
View
5 gemfiles/Rails-3-0.gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "rails", "~> 3.0.0"
-
-gemspec :path=>"../"
View
5 gemfiles/Rails-3-1.gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "rails", "~> 3.1.0"
-
-gemspec :path=>"../"
View
5 gemfiles/Rails-3-2.gemfile
@@ -1,5 +0,0 @@
-source "http://rubygems.org"
-
-gem "rails", "~> 3.2.0"
-
-gemspec :path=>"../"
View
4 spec/dummy/app/models/place.rb
@@ -2,9 +2,9 @@
class Place
include Mongoid::Document
- #include Gmaps4rails::ActsAsGmappable
+ include Gmaps4rails::ActsAsGmappable
- # acts_as_gmappable :address => :address, :position => :pos
+ acts_as_gmappable :address => :address, :position => :pos
field :pos, :type => Array
field :address, :type => String
View
54 spec/models/place_spec.rb
@@ -1,41 +1,35 @@
-require 'spec_helper'
+if RUBY_VERSION == "1.9.3"
-include Geocoding
+ require 'spec_helper'
-set_gmaps4rails_options!
+ include Geocoding
-# Mongoid 3.x only
-require 'mongoid'
-require 'moped'
+ set_gmaps4rails_options!
-Mongoid.configure do |config|
- config.connect_to('mongoid_geo_test')
-end
+ # Mongoid 3.x only
+ require 'mongoid'
+ require 'moped'
-RSpec.configure do |config|
- # config.mock_with(:mocha)
-
- config.before(:each) do
- # Mongoid.purge!
+ Mongoid.configure do |config|
+ config.connect_to('mongoid_geo_test')
end
-end
-
-describe Gmaps4rails::ActsAsGmappable do
+ describe Gmaps4rails::ActsAsGmappable do
- let(:place) { Factory(:place) }
- let(:invalid_place) { Factory.build(:invalid_place) }
-
- before(:each) do
- Geocoding.stub_geocoding
- end
-
- context "standard configuration, valid place" do
- it "should save longitude and latitude to the customized position array" do
- # set_gmaps4rails_options!(:position => 'location')
- binding.pry
- place.pos.should_not be_nil
- place.should have_same_position_as TOULON
+ let(:place) { Factory(:place) }
+ let(:invalid_place) { Factory.build(:invalid_place) }
+
+ before(:each) do
+ Geocoding.stub_geocoding
+ end
+
+ context "standard configuration, valid place" do
+ it "should save longitude and latitude to the customized position array" do
+ set_gmaps4rails_options!(:position => 'location')
+ place.pos.should_not be_nil
+ place.should have_same_position_as TOULON
+ end
end
end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.