Closed seuros closed 9 years ago
Coolio! Will try it tomorrow (feel free to make it 1.0).
I am still at 0.1.12 Got many error when upgrading to 0.2.x No time to find out why Q_Q
What kind of errors, @PikachuEXE ?
Leaving office now. I will tell you tomorrow
Not sure what's happened, now the error is gone (I don't quite remember what's wrong when I was upgrading to 0.2.*
)
Let me try this PR now
I got:
undefined method `polymorphic_path'
undefined method `render_cell'
in all cell spec
can you paste the spec ?
Lazy and busy, so I just paste here:
require 'spec_helper'
describe UserMenuCell do
describe "cell rendering" do
describe "#show" do
context 'when is_mobile is true' do
subject { render_cell(:user_menu, :show, current_user: current_user, is_mobile: false) }
context 'when user is not logged in' do
let(:current_user) { nil }
it { should have_link(I18n.t('cells.user_menu.sign_up', href: new_user_registration_path)) }
it { should have_link(I18n.t('cells.user_menu.sign_in', href: new_user_session_path)) }
it_behaves_like 'cell with caching'
end
context 'when user is logged in' do
let(:current_user) { create(:user) }
describe 'dropdown menu' do
it {should have_selector('.dropdown .dropdown-toggle')}
it {should have_selector('.dropdown .dropdown-menu')}
end
it {should have_link(I18n.t('cells.user_menu.settings', href: my_settings_path))}
it {should have_link(I18n.t('cells.user_menu.sign_out', href: destroy_user_session_path))}
it_behaves_like 'cell with caching'
end
end
context 'when is_mobile is false' do
subject { render_cell(:user_menu, :show, current_user: current_user, is_mobile: true) }
context 'when user is not logged in' do
let(:current_user) { nil }
it { should have_link(I18n.t('cells.user_menu.sign_up', href: new_user_registration_path)) }
it { should have_link(I18n.t('cells.user_menu.sign_in', href: new_user_session_path)) }
it_behaves_like 'cell with caching'
end
context 'when user is logged in' do
let(:current_user) { create(:user) }
it {should have_link(I18n.t('cells.user_menu.settings', href: my_settings_path))}
it {should have_link(I18n.t('cells.user_menu.sign_out', href: destroy_user_session_path))}
it_behaves_like 'cell with caching'
end
end
end
end
end
with errors like
undefined local variable or method `new_user_registration_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1::Nested_2::Nested_1:0x0000010b655430>
undefined method `render_cell' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1::Nested_2::Nested_2::Nested_1::Nested_1:0x0000010f01a288>
Don't be lazy, you will evolve.
you need to have describe UserMenuCell, type: :cell do
OK even I have put describe UserMenuCell, type: :cell do
I still got the same errors
I don't think that's the problem since I have config.infer_spec_type_from_file_location!
and that works in 0.2.*
I will work hard to NOT evolve :D
@apotonick Any update ? Did you had a chance to test this PR ?
I'll give it a go tomorrow! Thanks!
No movement ._.?
Absolutely, we decided to wait until Cells 4.0 is released, then update rspec-cells, which should be pretty easy, then.
Sure :>
@apotonick @pikachuexe
Can you try this branch in your existing apps.