Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RSpec.configure do |config|
- config.use_transactional_fixtures = false
- config.before(:suite) do
- DatabaseCleaner.clean_with(:truncation)
- end
- config.before(:each) do |example|
- DatabaseCleaner.strategy= example.metadata[:js] ? :truncation : :transaction
- DatabaseCleaner.start
- end
- config.after(:each) do
- DatabaseCleaner.clean
- end
- end
- FactoryGirl.define do
- factory :post, :class => MyEngine::Post do
- title 'title'
- end
- end
- require 'spec_helper'
- describe 'Post', :type => :feature do
- let(:post) { FactoryGirl.create :post }
- it 'index action should have post' do
- visit posts_path
- expect(page).to have_text(post.title)
- end
- end
- INSERT INTO "my_engine_posts" ...
- RELEASE SAVEPOINT active_record_1
- rollback transaction
- expect(page).to have_text(post.title)
- require 'spec_helper'
- describe 'Post', :type => :feature do
- let(:post) { FactoryGirl.create :post }
- it 'index action should have post' do
- post
- visit posts_path
- expect(page).to have_text(post.title)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement