forked from spree/spree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit contains a whole bunch of changes, from pull request spree#1296 which will fix spree#1292. To understand the gist of the problem, please see the comment threads in The main bunch of work that was done here was done in two parts: remove all current_user references from Core and to isolate each component during its testing so that it is not loading all of Spree for each component, just the bare-bones components that are needed. For instance, Core now will only load Core. API will now load API, Auth and Core. Dash will load Auth and Core. Promo will load Auth and Core.
- Loading branch information
Showing
65 changed files
with
164 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,15 @@ env: | |
- DB=sqlite | ||
- DB=mysql | ||
- DB=postgres | ||
script: "DISPLAY=:99.0 bundle exec rake" | ||
script: | ||
- "export DISPLAY=:99.0" | ||
- "alias set_gemfile='export BUNDLE_GEMFILE=\"`pwd`/Gemfile\"'" | ||
- "cd api; set_gemfile; bundle install --quiet; bundle exec rspec spec" | ||
- "cd ../auth; set_gemfile; bundle install --quiet; bundle exec rspec spec" | ||
- "cd ../core; set_gemfile; bundle install --quiet; bundle exec rspec spec" | ||
- "cd ../dash; set_gemfile; bundle install --quiet; bundle exec rspec spec" | ||
- "cd ../promo; set_gemfile; bundle install --quiet; bundle exec rspec spec" | ||
|
||
notifications: | ||
email: | ||
- [email protected] | ||
|
@@ -14,6 +22,7 @@ branches: | |
only: | ||
- 1-0-stable | ||
- master | ||
- isolation | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,3 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'json' | ||
gem 'sqlite3' | ||
gem 'mysql2' | ||
gem 'pg' | ||
|
||
# Gems used only for assets and not required | ||
# in production environments by default. | ||
group :assets do | ||
gem 'sass-rails', "~> 3.2" | ||
gem 'coffee-rails', "~> 3.2" | ||
end | ||
|
||
group :test do | ||
gem 'guard' | ||
gem 'guard-rspec', '~> 0.5.0' | ||
gem 'rspec-rails', '~> 2.8.0' | ||
gem 'factory_girl_rails', '~> 1.7.0' | ||
gem 'email_spec', '~> 1.2.1' | ||
|
||
platform :ruby_18 do | ||
gem 'rcov' | ||
end | ||
|
||
platform :ruby_19 do | ||
gem 'simplecov' | ||
end | ||
|
||
gem 'ffaker' | ||
gem 'shoulda-matchers', '~> 1.0.0' | ||
gem 'capybara' | ||
gem 'selenium-webdriver', '2.16.0' | ||
gem 'database_cleaner', '0.7.1' | ||
gem 'launchy' | ||
end | ||
|
||
# platform :ruby_18 do | ||
# gem "ruby-debug" | ||
# end | ||
|
||
# platform :ruby_19 do | ||
# gem "ruby-debug19" | ||
# end | ||
eval(File.read(File.dirname(__FILE__) + '/common_spree_dependencies.rb')) | ||
|
||
gemspec | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb')) | ||
|
||
gem 'spree_core', :path => '../core' | ||
gem 'spree_auth', :path => '../auth' | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb')) | ||
|
||
gem 'spree_core', :path => '../core' | ||
|
||
gemspec |
16 changes: 16 additions & 0 deletions
16
auth/app/controllers/spree/admin/admin_users_controller_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
require File.expand_path('../../base_controller_decorator', __FILE__) | ||
Spree::Admin::UsersController.class_eval do | ||
rescue_from Spree::User::DestroyWithOrdersError, :with => :user_destroy_with_orders_error | ||
|
||
update.after :sign_in_if_change_own_password | ||
|
||
before_filter :load_roles, :only => [:edit, :new, :update, :create] | ||
|
||
private | ||
|
||
def sign_in_if_change_own_password | ||
if current_user == @user && @user.password.present? | ||
sign_in(@user, :event => :authentication, :bypass => true) | ||
end | ||
end | ||
|
||
def load_roles | ||
@roles = Spree::Role.scoped | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Deface::Override.new(:virtual_path => "spree/admin/payment_methods/index", | ||
:name => "gateway_banner", | ||
:insert_after => "#listing_payment_methods", | ||
:partial => "spree/admin/banners/gateway") | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Users' do | ||
before do | ||
user = Factory(:admin_user, :email => "[email protected]") | ||
sign_in_as!(user) | ||
visit spree.admin_users_path | ||
end | ||
|
||
context "editing own user" do | ||
it "should let me edit own password" do | ||
click_link("[email protected]") | ||
click_link("Edit") | ||
fill_in "user_password", :with => "welcome" | ||
fill_in "user_password_confirmation", :with => "welcome" | ||
click_button "Update" | ||
|
||
page.should have_content("successfully updated!") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# By placing all of Spree's shared dependencies in this file and then loading | ||
# it for each component's Gemfile, we can be sure that we're only testing just | ||
# the one component of Spree. | ||
source 'http://rubygems.org' | ||
|
||
gem 'json' | ||
gem 'sqlite3' | ||
gem 'mysql2' | ||
gem 'pg' | ||
|
||
# Gems used only for assets and not required | ||
# in production environments by default. | ||
group :assets do | ||
gem 'sass-rails', "~> 3.2" | ||
gem 'coffee-rails', "~> 3.2" | ||
end | ||
|
||
group :test do | ||
gem 'guard' | ||
gem 'guard-rspec', '~> 0.5.0' | ||
gem 'rspec-rails', '~> 2.8.0' | ||
gem 'factory_girl_rails', '~> 1.7.0' | ||
gem 'email_spec', '~> 1.2.1' | ||
|
||
platform :ruby_18 do | ||
gem 'rcov' | ||
end | ||
|
||
platform :ruby_19 do | ||
gem 'simplecov' | ||
end | ||
|
||
gem 'ffaker' | ||
gem 'shoulda-matchers', '~> 1.0.0' | ||
gem 'capybara' | ||
gem 'selenium-webdriver', '2.16.0' | ||
gem 'database_cleaner', '0.7.1' | ||
gem 'launchy' | ||
end | ||
|
||
# platform :ruby_18 do | ||
# gem "ruby-debug" | ||
# end | ||
|
||
# platform :ruby_19 do | ||
# gem "ruby-debug19" | ||
# end | ||
|
||
gemspec | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
eval(File.read(File.dirname(__FILE__) + '/../common_spree_dependencies.rb')) | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,5 +37,3 @@ | |
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<%= render :partial => 'spree/admin/banners/gateway' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
core/lib/spree/core/testing_support/factories/product_factory.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
core/spec/controllers/spree/admin/image_settings_controller_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.