Skip to content

Commit afc0cca

Browse files
committed
Continues fixing tests.
1 parent 1a17d48 commit afc0cca

File tree

18 files changed

+48
-27
lines changed

18 files changed

+48
-27
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ group :development do
2828
gem 'quiet_assets'
2929
gem 'better_errors'
3030
gem 'binding_of_caller'
31+
gem 'pry'
3132
end
3233
group :test, :development do
3334
gem 'minitest', '~>5.3.3'
35+
gem "test-unit", "~> 3.0"
3436
gem 'minitest-rails', '~>2.0.0'
3537
gem 'minitest-reporters', '~>1.0.0'
3638
end

Gemfile.lock

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PATH
1414
paperclip (~> 3.4)
1515
rails (~> 4.2.0)
1616
sass-rails
17-
simple_form (>= 3.0.0.rc, < 3.1)
17+
simple_form (~> 3.1.0)
1818
term-ansicolor
1919
underscore-rails (~> 1.4)
2020
will_paginate (~> 3.0.0)
@@ -206,6 +206,11 @@ GEM
206206
capybara (~> 2.1.0)
207207
faye-websocket (>= 0.4.4, < 0.5.0)
208208
http_parser.rb (~> 0.5.3)
209+
power_assert (1.0.1)
210+
pry (0.10.4)
211+
coderay (~> 1.1.0)
212+
method_source (~> 0.8.1)
213+
slop (~> 3.4)
209214
quiet_assets (1.0.2)
210215
railties (>= 3.1, < 5.0)
211216
rack (1.6.5)
@@ -252,11 +257,12 @@ GEM
252257
sprockets (>= 2.8, < 4.0)
253258
sprockets-rails (>= 2.0, < 4.0)
254259
tilt (>= 1.1, < 3)
255-
simple_form (3.1.0.rc2)
260+
simple_form (3.1.1)
256261
actionpack (~> 4.0)
257262
activemodel (~> 4.0)
258263
single_test (0.6.0)
259264
rake
265+
slop (3.6.0)
260266
sprockets (3.7.1)
261267
concurrent-ruby (~> 1.0)
262268
rack (> 1, < 3)
@@ -269,6 +275,8 @@ GEM
269275
sqlite3 (>= 1.3.3)
270276
term-ansicolor (1.4.0)
271277
tins (~> 1.0)
278+
test-unit (3.2.3)
279+
power_assert
272280
thin (1.5.1)
273281
daemons (>= 1.0.9)
274282
eventmachine (>= 0.12.6)
@@ -312,13 +320,15 @@ DEPENDENCIES
312320
mocha
313321
mysql2
314322
poltergeist
323+
pry
315324
quiet_assets
316325
rake
317326
ruby-prof
318327
sass-rails (~> 5.0.0)
319328
single_test
320329
sprockets-rails (~> 2.3.1)
321330
sqlite3-ruby
331+
test-unit (~> 3.0)
322332
thin
323333
uglifier
324334
yard

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def run_tests(tests_to_run)
9191
Rake::Task[task].invoke
9292
nil
9393
rescue => e
94-
puts e
9594
{:task => task, :exception => e}
9695
end
9796
end.compact

app/models/cms/page.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ def connectable_count_for_container(container)
370370
end
371371

372372
def name_with_section_path
373-
a = ancestors
374-
(a[1..a.size].map { |a| a.name } + [name]).join(" / ")
373+
anc = ancestors
374+
(anc[1..anc.size].map { |a| a.name } + [name]).join(" / ")
375375
end
376376

377377
# @return [Boolean] true if this page is the home page of the site.

browsercms.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
4444
s.add_dependency("panoramic")
4545
s.add_dependency("will_paginate", "~>3.0.0")
4646
s.add_dependency("actionpack-page_caching", "~>1.0")
47-
s.add_dependency("simple_form", ">= 3.0.0.rc", "< 3.1")
47+
s.add_dependency("simple_form", "~>3.1.0")
4848

4949
# Required only for bcms-upgrade
5050
s.add_dependency "term-ansicolor"

features/commands/generate_module.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Generate Module
99
@known-bug
1010
Scenario: Create a BrowserCMS module
1111
When I create a module named "bcms_store"
12-
Then a rails engine named "bcms_store" should exist
12+
Then "bcms_store" should exist
1313
And BrowserCMS should be added the .gemspec file
1414
And a file named "bcms_store/test/dummy/app/views/layouts/templates/default.html.erb" should exist
1515

features/support/env.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#Capybara.javascript_driver = :poltergeist
1818
#Capybara.default_driver = :poltergeist
1919

20+
21+
2022
Before do
2123
# Configure where Aruba generates files.
2224
# You can't generate rails projects within rails projects', so it needs to be parallel to the browsercms project
@@ -84,3 +86,5 @@
8486
require File.join(File.dirname(__FILE__), '../../db/seeds.rb')
8587
end
8688

89+
require 'test/unit/assertions'
90+
World Test::Unit::Assertions

features/support/minitest.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'minitest/unit'
2+
World(MiniTest::Assertions)

lib/cms/behaviors/publishing.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def is_publishable(options={})
4242
module ClassMethods
4343
end
4444
module InstanceMethods
45-
4645
# Can specify whether to save this block as a draft using a terser syntax.
4746
# These two calls behave identically
4847
# - Cms::HtmlBlock.create(name: "Shorter", as: :draft)
@@ -152,7 +151,7 @@ def publish!
152151
self.class.connection.update(
153152
"UPDATE #{self.class.quoted_table_name} " +
154153
"SET published = #{self.class.connection.quote(true, self.class.columns_hash["published"])} " +
155-
"WHERE #{self.class.connection.quote_column_name(self.class.primary_key)} = #{self.class.quote_value(id)}",
154+
"WHERE #{self.class.connection.quote_column_name(self.class.primary_key)} = #{self.class.quote_value(id, nil)}",
156155
"#{self.class.name.demodulize} Publish"
157156
)
158157
did_publish = true

lib/cms/behaviors/soft_deleting.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def mark_as_deleted!
9191
end
9292

9393
def destroy!
94-
transaction { super.destroy }
94+
transaction { super.destroy if super!=true }
9595
end
9696

9797
def destroyed?

0 commit comments

Comments
 (0)