refinerycms-settings 2.0.3 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c63b128a70282fdcf67dad43bfa02430bfe74012
4
- data.tar.gz: 66490d66e0fd27b668260e55a79dc497952bc5de
3
+ metadata.gz: 9775cec5ba773f8cc291a7ded3a154814169ab4e
4
+ data.tar.gz: d91fc0d665c2e312c28d629ddf9222983323ce54
5
5
  SHA512:
6
- metadata.gz: 37b3ce800230ef6ce6528036d9ea8eeb13529260bcc1fe08495ae823b17e1844edadcdd3e8892ab0b86613ce2030b860eee28db75ffc87325b8a695c64b702a4
7
- data.tar.gz: 1ac20bb6ed79030cfd20a7b27bdadaf17eeafd7447c2967d421ec186cf18acc212e80dc4ee1559ca1b8dbce07d922a9f3f3706b391acf028ddbebc9e8fc24a19
6
+ metadata.gz: 02cde442a3a360fddcb55e64015c93c5d440f0102a432117142b28c2fc8b9789f0dd84fd27718458f38e7b36e8c59ed3d74a61f8c8fd44789a753d2cc893f559
7
+ data.tar.gz: 025f977452a4249909ad7b6257dbcd85beca3436b690c22306a5d979939c3bdcf2fa25c596f51a70b113a8c5e7c571e5f990331e8b8c8d5f2659f595bb9fa3cb
data/.gitignore CHANGED
@@ -1,3 +1,6 @@
1
1
  .DS_Store
2
2
  Gemfile.lock
3
3
  spec/dummy
4
+
5
+ # Local Gemfile for developing without sharing dependencies
6
+ .gemfile
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
- before_install:
3
- - 'if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]] ; then gem update --system ; fi'
2
+ bundler_args: --without development
4
3
  before_script:
5
4
  - "sh -e /etc/init.d/xvfb start"
6
- - "bundle exec rake refinery:testing:dummy_app > /dev/null"
5
+ - "bundle exec rake refinery:testing:dummy_app"
7
6
  script:
8
7
  - "DISPLAY=:99.0 bundle exec rspec spec"
9
8
  notifications:
@@ -23,14 +22,9 @@ env:
23
22
  - DB=mysql
24
23
  matrix:
25
24
  allow_failures:
26
- - rvm: rbx-18mode
27
25
  - rvm: rbx-19mode
28
- - rvm: jruby-19mode
29
- - rvm: jruby-18mode
30
26
  rvm:
27
+ - 2.0.0
31
28
  - 1.9.3
32
- - 1.8.7
33
29
  - rbx-19mode
34
30
  - jruby-19mode
35
- - rbx-18mode
36
- - jruby-18mode
data/Gemfile CHANGED
@@ -1,64 +1,30 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'refinerycms', '~> 2.0.1'
5
+ gem 'refinerycms', '~> 2.1.0'
6
+ gem 'refinerycms-testing', '~> 2.1.0', :group => :test
7
+ gem 'refinerycms-acts-as-indexed', '~> 1.0.0'
6
8
 
7
- group :development, :test do
8
- gem 'refinerycms-testing', '~> 2.0.1'
9
- gem 'guard-rspec', '~> 0.6.0'
10
-
11
- platforms :jruby do
12
- gem 'activerecord-jdbcsqlite3-adapter'
13
- gem 'activerecord-jdbcmysql-adapter'
14
- gem 'activerecord-jdbcpostgresql-adapter'
15
- gem 'jruby-openssl'
16
- end
17
-
18
- unless defined?(JRUBY_VERSION)
19
- gem 'sqlite3'
20
- gem 'mysql2'
21
- gem 'pg'
22
- end
23
-
24
- platforms :mswin, :mingw do
25
- gem 'win32console'
26
- gem 'rb-fchange', '~> 0.0.5'
27
- gem 'rb-notifu', '~> 0.0.4'
28
- end
29
-
30
- platforms :ruby do
31
- gem 'spork', '~> 0.9.0.rc'
32
- gem 'guard-spork'
9
+ # Database Configuration
10
+ unless ENV['TRAVIS']
11
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
12
+ gem 'sqlite3', :platform => :ruby
13
+ end
33
14
 
34
- unless ENV['TRAVIS']
35
- require 'rbconfig'
36
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
37
- gem 'rb-fsevent', '>= 0.3.9'
38
- gem 'ruby_gntp'
39
- end
40
- if RbConfig::CONFIG['target_os'] =~ /linux/i
41
- gem 'rb-inotify', '>= 0.5.1'
42
- gem 'libnotify', '~> 0.1.3'
43
- gem 'therubyracer', '~> 0.9.9'
44
- end
45
- end
46
- end
15
+ if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
16
+ gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
17
+ gem 'jdbc-mysql', '= 5.1.13', :platform => :jruby
18
+ gem 'mysql2', :platform => :ruby
19
+ end
47
20
 
48
- platforms :jruby do
49
- unless ENV['TRAVIS']
50
- require 'rbconfig'
51
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
52
- gem 'ruby_gntp'
53
- end
54
- if RbConfig::CONFIG['target_os'] =~ /linux/i
55
- gem 'rb-inotify', '>= 0.5.1'
56
- gem 'libnotify', '~> 0.1.3'
57
- end
58
- end
59
- end
21
+ if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
22
+ gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
23
+ gem 'pg', :platform => :ruby
60
24
  end
61
25
 
26
+ gem 'jruby-openssl', :platform => :jruby
27
+
62
28
  # Refinery/rails should pull in the proper versions of these
63
29
  group :assets do
64
30
  gem 'sass-rails'
@@ -66,4 +32,7 @@ group :assets do
66
32
  gem 'uglifier'
67
33
  end
68
34
 
69
- gem 'jquery-rails'
35
+ # Load local gems according to Refinery developer preference.
36
+ if File.exist? local_gemfile = File.expand_path('../.gemfile', __FILE__)
37
+ eval File.read(local_gemfile)
38
+ end
data/Rakefile CHANGED
@@ -17,3 +17,5 @@ Refinery::Testing::Railtie.load_tasks
17
17
  Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
18
18
 
19
19
  load File.expand_path('../tasks/rspec.rake', __FILE__)
20
+
21
+ task :default => :spec
@@ -1,7 +1,7 @@
1
1
  module Refinery
2
2
  class Setting < Refinery::Core::BaseModel
3
3
  extend FriendlyId
4
- friendly_id :name
4
+ friendly_id :name, :use => :slugged
5
5
 
6
6
  FORM_VALUE_TYPES = [
7
7
  ['Multi-line', 'text_area'],
@@ -12,9 +12,6 @@ module Refinery
12
12
 
13
13
  serialize :value # stores into YAML format
14
14
 
15
- # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
16
- acts_as_indexed :fields => [:name]
17
-
18
15
  attr_accessible :name, :value, :destroyable,
19
16
  :scoping, :restricted, :form_value_type
20
17
 
@@ -25,7 +22,7 @@ module Refinery
25
22
  after_save do |setting|
26
23
  setting.class.rewrite_cache
27
24
  end
28
-
25
+
29
26
  after_destroy do |setting|
30
27
  setting.class.rewrite_cache
31
28
  end
@@ -1,8 +1,4 @@
1
- <% if searching? %>
2
- <h2>
3
- <%= t('results_for', :scope => 'refinery.admin.search', :query => params[:search]) %>
4
- </h2>
5
- <% end %>
1
+ <%= render 'refinery/admin/search_header', :url => refinery.admin_settings_path %>
6
2
  <div class='pagination_container'>
7
3
  <% if @settings.any? %>
8
4
  <%= render 'settings' %>
@@ -18,4 +14,4 @@
18
14
  <% end %>
19
15
  </p>
20
16
  <% end %>
21
- </div>
17
+ </div>
@@ -18,14 +18,6 @@ es:
18
18
  enabled: "Si, habilita esta funcionalidad"
19
19
  restart_may_be_in_order_html: <strong>Recuerda</strong> que puede que necesites reiniciar tu web para que esta opción haga efecto.
20
20
  yes_make_this_setting_restricted: "Sí, restringir esta opción sólo para superusuarios."
21
- title:
22
- frontend_refinery_stylesheets_enabled: Hojas de estilo de refinery en el frontend
23
- i18n_translation_current_locale: Idioma actual (Refinery)
24
- i18n_translation_default_frontend_locale: Idioma por defecto en el frontend (Refinery)
25
- i18n_translation_default_locale: Idioma por defecto (Refinery)
26
- i18n_translation_enabled: Traducción activada (Refinery)
27
- i18n_translation_frontend_locales: Idiomas disponibles en el frontend (Refinery)
28
- i18n_translation_locales: Idiomas disponibles (Refinery)
29
21
  help:
30
22
  restricted: Hace que sólo los superusuarios (como tu) puedan ver y editar esta opción.
31
23
  activerecord:
@@ -1,6 +1,6 @@
1
1
  Refinery::Core::Engine.routes.draw do
2
2
  if Refinery::Settings.enable_interface
3
- namespace :admin, :path => 'refinery' do
3
+ namespace :admin, :path => Refinery::Core.backend_route do
4
4
  resources :settings, :except => :show
5
5
  end
6
6
  end
@@ -0,0 +1,5 @@
1
+ class AddSlugToRefinerySettings < ActiveRecord::Migration
2
+ def change
3
+ add_column :refinery_settings, :slug, :string, :unique => true
4
+ end
5
+ end
@@ -1,5 +1,4 @@
1
1
  require 'refinerycms-core'
2
- require 'acts_as_indexed'
3
2
 
4
3
  module Refinery
5
4
  autoload :SettingsGenerator, 'generators/refinery/settings_generator'
@@ -12,7 +12,6 @@ module Refinery
12
12
  Refinery::Plugin.register do |plugin|
13
13
  plugin.pathname = root
14
14
  plugin.name = 'refinery_settings'
15
- plugin.version = %q{2.0.0}
16
15
  plugin.menu_match = %r{refinery/settings$}
17
16
  plugin.hide_from_menu = !Refinery::Settings.enable_interface
18
17
  plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.admin_settings_path }
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = %q{refinerycms-settings}
6
- s.version = %q{2.0.3}
6
+ s.version = %q{2.1.0}
7
7
  s.summary = %q{Settings engine for Refinery CMS}
8
8
  s.description = %q{Adds programmer creatable, user editable settings.}
9
9
  s.email = %q{info@refinerycms.com}
@@ -16,6 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- spec/*`.split("\n")
18
18
 
19
- s.add_dependency 'refinerycms-core', '~> 2.0.10'
20
- s.add_dependency 'acts_as_indexed', '~> 0.7.7'
19
+ s.add_dependency 'refinerycms-core', '~> 2.1.0'
21
20
  end
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  module Refinery
4
4
  module Admin
5
5
  describe "Settings" do
6
- login_refinery_user
6
+ refinery_login_with :refinery_user
7
7
 
8
8
  context "when interface config is enabled" do
9
9
  before do
@@ -19,7 +19,7 @@ module Refinery
19
19
  end
20
20
 
21
21
  context "when no settings" do
22
- before(:each) { Refinery::Setting.destroy_all }
22
+ before { Refinery::Setting.destroy_all }
23
23
 
24
24
  it "invites to create one" do
25
25
  visit refinery.admin_settings_path
@@ -41,19 +41,39 @@ module Refinery
41
41
  page.should have_selector('iframe#dialog_iframe')
42
42
 
43
43
  page.within_frame('dialog_iframe') do
44
- fill_in "Name", :with => "test setting"
45
- fill_in "Value", :with => "true"
44
+ fill_in "setting_name", :with => "test setting"
45
+ fill_in "setting_value", :with => "true"
46
46
 
47
- click_button "Save"
47
+ click_button "submit_button"
48
48
  end
49
49
 
50
50
  page.should have_content("'Test Setting' was successfully added.")
51
51
  page.should have_content("Test Setting - true")
52
52
  end
53
+
54
+ it "adds setting with slug unfriendly name", :js => true do
55
+ visit refinery.admin_settings_path
56
+ click_link "Add new setting"
57
+
58
+ page.should have_selector('iframe#dialog_iframe')
59
+
60
+ page.within_frame('dialog_iframe') do
61
+ fill_in "setting_name", :with => "Test/Setting"
62
+ fill_in "setting_value", :with => "true"
63
+
64
+ click_button "submit_button"
65
+ end
66
+
67
+ page.should have_content("'Test/Setting' was successfully added.")
68
+ page.should have_content("Test/Setting - true")
69
+
70
+ visit refinery.edit_admin_setting_path(Refinery::Setting.last)
71
+ page.should_not have_content('NoMethodError in Refinery::Admin::BaseController#error_404')
72
+ end
53
73
  end
54
74
 
55
75
  context "pagination" do
56
- before(:each) do
76
+ before do
57
77
  (Refinery::Setting.per_page + 1).times do
58
78
  FactoryGirl.create(:setting)
59
79
  end
@@ -3,95 +3,114 @@ require 'spec_helper'
3
3
  module Refinery
4
4
  describe Setting do
5
5
 
6
- before(:each) do
6
+ before do
7
7
  ::Refinery::Setting.set(:creating_from_scratch, nil)
8
8
  ::Refinery::Setting.set(:rspec_testing_creating_from_scratch, nil)
9
9
  end
10
10
 
11
+ context "slug" do
12
+ it "should create correct slug" do
13
+ ::Refinery::Setting.set('test/something', {:value => "Look, a value"})
14
+ ::Refinery::Setting.last.to_param.should eq('test-something')
15
+ end
16
+ end
17
+
11
18
  context "set" do
19
+ it "should save and get @keram" do
20
+ ::Refinery::Setting.find_or_set(:twitter, '@keram')
21
+ setting = ::Refinery::Setting.last
22
+ setting.value.should eq('@keram')
23
+ end
24
+
25
+ it "should not strip whitespaces" do
26
+ ::Refinery::Setting.find_or_set(:author, ' benbruscella ')
27
+ setting = ::Refinery::Setting.last
28
+ setting.value.should eq(' benbruscella ')
29
+ end
30
+
12
31
  it "should create a setting that didn't exist" do
13
32
  ::Refinery::Setting.get(:creating_from_scratch, :scoping => 'rspec_testing').should eq(nil)
14
33
  ::Refinery::Setting.set(:creating_from_scratch, {:value => "Look, a value", :scoping => 'rspec_testing'}).should eq("Look, a value")
15
34
  end
16
35
 
17
36
  it "should override an existing setting" do
18
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
19
- @set.should eq("a value")
37
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
38
+ set.should eq("a value")
20
39
 
21
- @new_set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "newer replaced value", :scoping => 'rspec_testing'})
22
- @new_set.should eq("newer replaced value")
40
+ new_set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "newer replaced value", :scoping => 'rspec_testing'})
41
+ new_set.should eq("newer replaced value")
23
42
  end
24
43
 
25
44
  it "should default to form_value_type text_area" do
26
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
45
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "a value", :scoping => 'rspec_testing'})
27
46
  ::Refinery::Setting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'}).form_value_type.should eq("text_area")
28
47
  end
29
48
 
30
49
  it "should fix true as a value to 'true' (string)" do
31
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => true, :scoping => 'rspec_testing'})
50
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => true, :scoping => 'rspec_testing'})
32
51
  ::Refinery::Setting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should eq('true')
33
- @set.should eq(true)
52
+ set.should eq(true)
34
53
  end
35
54
 
36
55
  it "should fix false as a value to 'false' (string)" do
37
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => false, :scoping => 'rspec_testing'})
56
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => false, :scoping => 'rspec_testing'})
38
57
  ::Refinery::Setting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should eq('false')
39
- @set.should eq(false)
58
+ set.should eq(false)
40
59
  end
41
60
 
42
61
  it "should fix '1' as a value with a check_box form_value_type to true" do
43
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "1", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
62
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "1", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
44
63
  ::Refinery::Setting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should eq('true')
45
- @set.should eq(true)
64
+ set.should eq(true)
46
65
  end
47
66
 
48
67
  it "should fix '0' as a value with a check_box form_value_type to false" do
49
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "0", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
68
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "0", :scoping => 'rspec_testing', :form_value_type => 'check_box'})
50
69
  ::Refinery::Setting.find_by_name(:creating_from_scratch.to_s, :conditions => {:scoping => 'rspec_testing'})[:value].should eq('false')
51
- @set.should eq(false)
70
+ set.should eq(false)
52
71
  end
53
72
  end
54
73
 
55
74
  context "get" do
56
75
  it "should retrieve a seting that was created" do
57
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
58
- @set.should eq('some value')
76
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
77
+ set.should eq('some value')
59
78
 
60
- @get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => 'rspec_testing')
61
- @get.should eq('some value')
79
+ get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => 'rspec_testing')
80
+ get.should eq('some value')
62
81
  end
63
82
 
64
83
  it "should also work with setting scoping using string and getting via symbol" do
65
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
66
- @set.should eq('some value')
84
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => 'rspec_testing'})
85
+ set.should eq('some value')
67
86
 
68
- @get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => :rspec_testing)
69
- @get.should eq('some value')
87
+ get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => :rspec_testing)
88
+ get.should eq('some value')
70
89
  end
71
90
 
72
91
  it "should also work with setting scoping using symbol and getting via string" do
73
- @set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => :rspec_testing})
74
- @set.should eq('some value')
92
+ set = ::Refinery::Setting.set(:creating_from_scratch, {:value => "some value", :scoping => :rspec_testing})
93
+ set.should eq('some value')
75
94
 
76
- @get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => 'rspec_testing')
77
- @get.should eq('some value')
95
+ get = ::Refinery::Setting.get(:creating_from_scratch, :scoping => 'rspec_testing')
96
+ get.should eq('some value')
78
97
  end
79
98
  end
80
99
 
81
100
  context "find_or_set" do
82
101
  it "should create a non existant setting" do
83
- @created = ::Refinery::Setting.find_or_set(:creating_from_scratch, 'I am a setting being created', :scoping => 'rspec_testing')
102
+ created = ::Refinery::Setting.find_or_set(:creating_from_scratch, 'I am a setting being created', :scoping => 'rspec_testing')
84
103
 
85
- @created.should eq("I am a setting being created")
104
+ created.should eq("I am a setting being created")
86
105
  end
87
106
 
88
107
  it "should not override an existing setting" do
89
- @created = ::Refinery::Setting.set(:creating_from_scratch, {:value => 'I am a setting being created', :scoping => 'rspec_testing'})
90
- @created.should eq("I am a setting being created")
108
+ created = ::Refinery::Setting.set(:creating_from_scratch, {:value => 'I am a setting being created', :scoping => 'rspec_testing'})
109
+ created.should eq("I am a setting being created")
91
110
 
92
- @find_or_set_created = ::Refinery::Setting.find_or_set(:creating_from_scratch, 'Trying to change an existing value', :scoping => 'rspec_testing')
111
+ find_or_set_created = ::Refinery::Setting.find_or_set(:creating_from_scratch, 'Trying to change an existing value', :scoping => 'rspec_testing')
93
112
 
94
- @created.should eq("I am a setting being created")
113
+ created.should eq("I am a setting being created")
95
114
  end
96
115
 
97
116
  it "should work without scoping" do
@@ -1,9 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
3
 
4
- describe "routes for refinery settings", :focus do
4
+ describe "routes for refinery settings" do
5
5
 
6
- context "when interface config is disabled", :focus do
6
+ context "when interface config is disabled" do
7
7
  before do
8
8
  Refinery::Settings.stub(:enable_interface).and_return(false)
9
9
  Refinery::Plugins.registered.find_by_name("refinery_settings").hide_from_menu = true
@@ -13,4 +13,4 @@ describe "routes for refinery settings", :focus do
13
13
  expect(:get => "/refinery/settings").to_not be_routable
14
14
  end
15
15
  end
16
- end
16
+ end
@@ -1,56 +1,30 @@
1
1
  require 'rubygems'
2
2
 
3
- def setup_environment
4
- # Configure Rails Environment
5
- ENV["RAILS_ENV"] ||= 'test'
3
+ # Configure Rails Environment
4
+ ENV["RAILS_ENV"] ||= 'test'
6
5
 
7
- require File.expand_path("../dummy/config/environment", __FILE__)
6
+ require File.expand_path("../dummy/config/environment", __FILE__)
8
7
 
9
- require 'rspec/rails'
10
- require 'capybara/rspec'
11
- require 'factory_girl_rails'
8
+ require 'rspec/rails'
9
+ require 'capybara/rspec'
10
+ require 'factory_girl_rails'
12
11
 
13
- Rails.backtrace_cleaner.remove_silencers!
12
+ Rails.backtrace_cleaner.remove_silencers!
14
13
 
15
- RSpec.configure do |config|
16
- config.mock_with :rspec
17
- config.treat_symbols_as_metadata_keys_with_true_values = true
18
- config.filter_run :focus => true
19
- config.run_all_when_everything_filtered = true
20
- end
21
-
22
- # set javascript driver for capybara
23
- Capybara.javascript_driver = :selenium
24
- end
25
-
26
- def each_run
27
- ActiveSupport::Dependencies.clear
28
-
29
- FactoryGirl.reload
30
-
31
- # Requires supporting files with custom matchers and macros, etc,
32
- # in ./support/ and its subdirectories including factories.
33
- ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
34
- Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
35
- }.flatten.sort.each do |support_file|
36
- require support_file
37
- end
14
+ RSpec.configure do |config|
15
+ config.mock_with :rspec
16
+ config.treat_symbols_as_metadata_keys_with_true_values = true
17
+ config.filter_run :focus => true
18
+ config.run_all_when_everything_filtered = true
38
19
  end
39
20
 
40
- # If spork is available in the Gemfile it'll be used but we don't force it.
41
- unless (begin; require 'spork'; rescue LoadError; nil end).nil?
42
- Spork.prefork do
43
- # Loading more in this block will cause your tests to run faster. However,
44
- # if you change any configuration or code from libraries loaded here, you'll
45
- # need to restart spork for it take effect.
46
- setup_environment
47
- end
21
+ # set javascript driver for capybara
22
+ Capybara.javascript_driver = :selenium
48
23
 
49
- Spork.each_run do
50
- # This code will be run each time you run your specs.
51
- each_run
52
- end
53
- else
54
- setup_environment
55
- each_run
24
+ # Requires supporting files with custom matchers and macros, etc,
25
+ # in ./support/ and its subdirectories including factories.
26
+ ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
27
+ Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
28
+ }.flatten.sort.each do |support_file|
29
+ require support_file
56
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-18 00:00:00.000000000 Z
12
+ date: 2013-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: refinerycms-core
@@ -17,28 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 2.0.10
20
+ version: 2.1.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 2.0.10
28
- - !ruby/object:Gem::Dependency
29
- name: acts_as_indexed
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ~>
33
- - !ruby/object:Gem::Version
34
- version: 0.7.7
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ~>
40
- - !ruby/object:Gem::Version
41
- version: 0.7.7
27
+ version: 2.1.0
42
28
  description: Adds programmer creatable, user editable settings.
43
29
  email: info@refinerycms.com
44
30
  executables: []
@@ -49,11 +35,8 @@ files:
49
35
  - .rspec
50
36
  - .travis.yml
51
37
  - Gemfile
52
- - Guardfile
53
38
  - Rakefile
54
39
  - app/controllers/refinery/admin/settings_controller.rb
55
- - app/decorators/controllers/refinery/.gitkeep
56
- - app/decorators/models/refinery/.gitkeep
57
40
  - app/helpers/refinery/admin/settings_helper.rb
58
41
  - app/models/refinery/setting.rb
59
42
  - app/views/refinery/admin/settings/_actions.html.erb
@@ -93,6 +76,7 @@ files:
93
76
  - config/locales/zh-TW.yml
94
77
  - config/routes.rb
95
78
  - db/migrate/20100913234710_create_refinerycms_settings_schema.rb
79
+ - db/migrate/20130414130143_add_slug_to_refinery_settings.rb
96
80
  - lib/generators/refinery/settings_generator.rb
97
81
  - lib/generators/refinery/templates/config/initializers/refinery/settings.rb.erb
98
82
  - lib/refinery/settings.rb
@@ -104,8 +88,8 @@ files:
104
88
  - refinerycms-settings.gemspec
105
89
  - script/rails
106
90
  - spec/factories/settings.rb
91
+ - spec/features/refinery/admin/settings_spec.rb
107
92
  - spec/models/refinery/setting_spec.rb
108
- - spec/requests/refinery/admin/settings_spec.rb
109
93
  - spec/routing/settings_routing_spec.rb
110
94
  - spec/spec_helper.rb
111
95
  - tasks/rspec.rake
@@ -129,14 +113,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
113
  version: '0'
130
114
  requirements: []
131
115
  rubyforge_project: refinerycms
132
- rubygems_version: 2.0.3
116
+ rubygems_version: 2.0.6
133
117
  signing_key:
134
118
  specification_version: 4
135
119
  summary: Settings engine for Refinery CMS
136
120
  test_files:
137
121
  - spec/factories/settings.rb
122
+ - spec/features/refinery/admin/settings_spec.rb
138
123
  - spec/models/refinery/setting_spec.rb
139
- - spec/requests/refinery/admin/settings_spec.rb
140
124
  - spec/routing/settings_routing_spec.rb
141
125
  - spec/spec_helper.rb
142
126
  has_rdoc:
data/Guardfile DELETED
@@ -1,20 +0,0 @@
1
- guard 'rspec', :version => 2, :cli => "--color" do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
5
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/controllers/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
6
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
- watch('config/routes.rb') { "spec/routing" }
9
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
10
- # Capybara request specs
11
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
12
- end
13
-
14
- guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
15
- watch('config/application.rb')
16
- watch('config/environment.rb')
17
- watch(%r{^config/environments/.+\.rb$})
18
- watch(%r{^config/initializers/.+\.rb$})
19
- watch('spec/spec_helper.rb')
20
- end
File without changes