- Fix test code for unique impressionist of instance with friendly_id

- Fixed rspec-rails version for run previous test cases
- Add friendly_id in gemfiles for run test case
This commit is contained in:
Md. Tauhidul Islam 2015-02-08 02:03:34 +06:00
parent 5573aebeaa
commit 66c7533f47
4 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,6 @@ group :test do
gem 'rspec-rails'
gem 'simplecov'
gem 'systemu'
gem 'friendly_id', '~> 4.0.9'
end
gemspec

View File

@ -18,9 +18,10 @@ group :test do
gem 'minitest'
gem 'minitest-rails'
gem 'rails', '~> 3.2.15'
gem 'rspec-rails'
gem 'rspec-rails', '~> 2.14.0'
gem 'simplecov'
gem 'systemu'
gem 'friendly_id', '~> 4.0.9'
end
gemspec :path => '../'

View File

@ -18,9 +18,10 @@ group :test do
gem 'minitest'
gem 'minitest-rails'
gem 'rails', '~> 4.0.1'
gem 'rspec-rails'
gem 'rspec-rails', '~> 2.14.0'
gem 'simplecov'
gem 'systemu'
gem 'friendly_id', '~> 5.1.0'
end
gemspec :path => '../'

View File

@ -308,12 +308,11 @@ describe DummyController do
describe 'impressionist with friendly id' do
it 'should unique' do
impressionable = Profile.find 1
# get 'profiles/test_profile'
# get 'profiles/test_profile'
impressionable = Profile.create({username: 'test_profile', slug: 'test_profile'})
controller.stub(:controller_name).and_return('profile')
controller.stub(:action_name).and_return('show')
controller.stub(:params).and_return({id: 'test_profile'})
controller.stub(:params).and_return({id: impressionable.slug})
controller.request.stub(:remote_ip).and_return('1.2.3.4')
controller.impressionist(impressionable, nil, :unique => [:impressionable_type, :impressionable_id])