Hi Javix

RSpec itself has no database integration so it's certainly possible, you'll 
need to either configure a connection manually to talk through or use however 
you'd normally talk to your other database.

If you’re using rspec-rails you’ll need to figure out how Rails does it’s 
transactional testing for multiple databases, but most 3rd party gems support 
“cleaning” multiple databases, including DatabaseCleaner.

HTH
Jon

On Wed, 27 Jun 2018 at 09:53, Javix <[email protected] 
(mailto:[email protected])> wrote:
> I need to execute some rake tasks agains a database other than defined in 
> database.yml, test group. Here is how database.yml looks like:
>  
> default: &default
>   adapter: postgresql
>   encoding: unicode
>   user: postgres
>   password:
>   pool: 5
>  
>  
> development:
>   <<: *default
>   database: decastore_development
>   host: <%= ENV['DECASTORE_DATABASE_HOST'] %>
>  
>  
> test:
>   <<: *default
>   database: decastore_test
>   host: <%= ENV['DECASTORE_DATABASE_HOST'] %>
>  
>  
> production:
>   <<: *default
>   host: <%= ENV['DECASTORE_DATABASE_HOST'] %>
>   database: XXXX
>   username: XXXXX
>   password: <%= ENV['DECASTORE_DATABASE_PASSWORD'] %>
>  
>  
> mystore:
>   adapter: oracle_enhanced
>   host: <%= ENV['mystore_db_host']%>
>   port: <%= ENV['mystore_db_port']%>
>   database: <%= ENV['mystore_db_name']%>
>   username: <%= ENV['mystore_db_user']%>
>   password: <%= ENV['mystore_db_password']%>
>  
>  
> Is it possible to mix 2 database settings when running tests or I have to 
> mock it everywhere ?
> Thank you.
>  
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> (mailto:[email protected]).
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rspec/f723fd63-26b2-4ff7-a9ff-b8a3a69567f3%40googlegroups.com
>  
> (https://groups.google.com/d/msgid/rspec/f723fd63-26b2-4ff7-a9ff-b8a3a69567f3%40googlegroups.com?utm_medium=email&utm_source=footer).
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CBC497E2EF0E40328F778556F9DCB90D%40jonrowe.co.uk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to