Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sbounmy committed Aug 26, 2013
1 parent 6d91bde commit 197ca4b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
source 'http://rubygems.org'

group :test do
gem 'ffaker'
gem 'debugger'
end

gemspec
2 changes: 1 addition & 1 deletion app/overrides/taxonomy_add_multi_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

Deface::Override.new(
:virtual_path => "spree/admin/taxons/edit",
:insert_before => "code[erb-loud]:contains('form_for [:admin, @taxonomy, @taxon], :method => :put, :html => { :multipart => true } do |f|')",
:insert_before => '[data-hook="buttons"]',
:text => '<%= render "spree/admin/taxons/multi_scripts", :object => @taxon -%>',
:name => "taxon_add_language_dropdown")
8 changes: 4 additions & 4 deletions spec/requests/taxons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

@taxonomy = Spree::Taxonomy.last

visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @taxonomy.root)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @taxonomy.root.id)

%w(fr en es).each do |locale|
select locale, :from => "spree_multi_lingual_dropdown"
Expand All @@ -60,7 +60,7 @@
end

scenario "admin should be able to edit taxons" do
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @taxonomy.root)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @taxonomy.root.id)

# verify if the form has correct values
%w(fr en es).each do |locale|
Expand All @@ -82,7 +82,7 @@
scenario "admin should be able to edit child taxons" do
@parent = Spree::Taxon.last
@child = FactoryGirl.create(:taxon, :name => "child", :parent => @parent, :taxonomy => @taxonomy)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @child)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @child.id)

# verify if the form has correct values
%w(fr en es).each do |locale|
Expand All @@ -107,7 +107,7 @@
@parent = Spree::Taxon.last
@child = FactoryGirl.create(:taxon, :name => "Sinatra En", :name_fr => "Sinatra Fr", :name_es => "Sinatra Es",
:permalink_fr => "sinatra-fr", :permalink => "sinatra-en", :permalink_es => "sinatra-es", :parent => @parent, :taxonomy => @taxonomy)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @parent)
visit spree.edit_admin_taxonomy_taxon_path(@taxonomy, @parent.id)

%w(fr en es).each do |locale|
select locale, :from => "spree_multi_lingual_dropdown"
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require File.expand_path("../dummy/config/environment.rb", __FILE__)

require 'rspec/rails'
require 'ffaker'
# require 'debugger'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand Down
1 change: 1 addition & 0 deletions spree_multi_lingual.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'awesome_print'
s.add_development_dependency 'deface', '~> 1.0.0.rc2'
s.add_development_dependency 'email_spec', '~> 1.2.1'
# s.add_development_dependency 'debugger'
# Seems Spree doesn't require it correctly or there is a problem with extensions maybe? Still, it is needed to work with the dummy app!
s.add_development_dependency 'sass-rails'
end

0 comments on commit 197ca4b

Please sign in to comment.