refinerycms-copywriting 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/refinery/copywriting/engine.rb +1 -1
- data/lib/tasks/rspec.rake +4 -0
- data/spec/helpers/copywriting_helper_spec.rb +3 -3
- data/spec/models/copywriting_phrase_spec.rb +1 -1
- data/spec/spec_helper.rb +55 -0
- metadata +3 -4
- data/features/manage_copywriting.feature +0 -36
- data/features/step_definitions/copywriting_steps.rb +0 -14
- data/features/support/paths.rb +0 -14
@@ -13,7 +13,7 @@ module Refinery
|
|
13
13
|
has_many :copywriting_phrases, :dependent => :destroy, :class_name => 'Refinery::Copywriting::Phrase'
|
14
14
|
accepts_nested_attributes_for :copywriting_phrases, :allow_destroy => false
|
15
15
|
attr_accessible :copywriting_phrases_attributes
|
16
|
-
end
|
16
|
+
end
|
17
17
|
end
|
18
18
|
|
19
19
|
after_inclusion do
|
@@ -30,7 +30,7 @@ describe CopywritingHelper do
|
|
30
30
|
copywriting("test with default scope")
|
31
31
|
end
|
32
32
|
|
33
|
-
Refinery::Copywriting::Phrase.where(:name => "test with default scope").scope.should == 'default_scope'
|
33
|
+
Refinery::Copywriting::Phrase.where(:name => "test with default scope").first.scope.should == 'default_scope'
|
34
34
|
end
|
35
35
|
|
36
36
|
it "it should allow you to overwrite the default options set with copywriting_options block" do
|
@@ -38,7 +38,7 @@ describe CopywritingHelper do
|
|
38
38
|
copywriting("test without default scope", {:scope => 'without_default_scope'})
|
39
39
|
end
|
40
40
|
|
41
|
-
Refinery::Copywriting::Phrase.where(:name => "test without default scope").scope.should == 'without_default_scope'
|
41
|
+
Refinery::Copywriting::Phrase.where(:name => "test without default scope").first.scope.should == 'without_default_scope'
|
42
42
|
end
|
43
43
|
|
44
44
|
it "it should clear the default options after copywriting_options block" do
|
@@ -47,7 +47,7 @@ describe CopywritingHelper do
|
|
47
47
|
end
|
48
48
|
copywriting("test outside default scope")
|
49
49
|
|
50
|
-
Refinery::Copywriting::Phrase.where(:name => "test outside default scope").scope.should_not == 'default_scope'
|
50
|
+
Refinery::Copywriting::Phrase.where(:name => "test outside default scope").first.scope.should_not == 'default_scope'
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
@@ -56,7 +56,7 @@ describe Refinery::Copywriting::Phrase do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should allow you to scope to a page" do
|
59
|
-
page = Page.create(:title => "test page")
|
59
|
+
page = Refinery::Page.create(:title => "test page")
|
60
60
|
|
61
61
|
name = "test_page"
|
62
62
|
Refinery::Copywriting::Phrase.for(name, :page => page)
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
def setup_environment
|
4
|
+
# Configure Rails Environment
|
5
|
+
ENV["RAILS_ENV"] ||= 'test'
|
6
|
+
|
7
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
8
|
+
|
9
|
+
require 'rspec/rails'
|
10
|
+
require 'factory_girl_rails'
|
11
|
+
|
12
|
+
Rails.backtrace_cleaner.remove_silencers!
|
13
|
+
|
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
|
19
|
+
end
|
20
|
+
|
21
|
+
# set javascript driver for capybara
|
22
|
+
Capybara.javascript_driver = :selenium
|
23
|
+
end
|
24
|
+
|
25
|
+
def each_run
|
26
|
+
ActiveSupport::Dependencies.clear
|
27
|
+
|
28
|
+
FactoryGirl.reload
|
29
|
+
|
30
|
+
# Requires supporting files with custom matchers and macros, etc,
|
31
|
+
# in ./support/ and its subdirectories including factories.
|
32
|
+
([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
|
33
|
+
Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
|
34
|
+
}.flatten.sort.each do |support_file|
|
35
|
+
require support_file
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# If spork is available in the Gemfile it'll be used but we don't force it.
|
40
|
+
unless (begin; require 'spork'; rescue LoadError; nil end).nil?
|
41
|
+
Spork.prefork do
|
42
|
+
# Loading more in this block will cause your tests to run faster. However,
|
43
|
+
# if you change any configuration or code from libraries loaded here, you'll
|
44
|
+
# need to restart spork for it take effect.
|
45
|
+
setup_environment
|
46
|
+
end
|
47
|
+
|
48
|
+
Spork.each_run do
|
49
|
+
# This code will be run each time you run your specs.
|
50
|
+
each_run
|
51
|
+
end
|
52
|
+
else
|
53
|
+
setup_environment
|
54
|
+
each_run
|
55
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-copywriting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -24,6 +24,7 @@ files:
|
|
24
24
|
- lib/refinery/copywriting.rb
|
25
25
|
- lib/refinerycms-copywriting.rb
|
26
26
|
- lib/tasks/copywritings.rake
|
27
|
+
- lib/tasks/rspec.rake
|
27
28
|
- config/locales/bg.yml
|
28
29
|
- config/locales/cs.yml
|
29
30
|
- config/locales/en.yml
|
@@ -53,9 +54,7 @@ files:
|
|
53
54
|
- db/seeds/copywritings.rb
|
54
55
|
- spec/helpers/copywriting_helper_spec.rb
|
55
56
|
- spec/models/copywriting_phrase_spec.rb
|
56
|
-
-
|
57
|
-
- features/step_definitions/copywriting_steps.rb
|
58
|
-
- features/support/paths.rb
|
57
|
+
- spec/spec_helper.rb
|
59
58
|
homepage: http://github.com/unixcharles/refinerycms-copywriting
|
60
59
|
licenses: []
|
61
60
|
post_install_message:
|
@@ -1,36 +0,0 @@
|
|
1
|
-
@copywritings
|
2
|
-
Feature: Copywritings
|
3
|
-
In order to have copywritings on my website
|
4
|
-
As an administrator
|
5
|
-
I want to manage copywritings
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given I am a logged in refinery user
|
9
|
-
And I have no copywritings
|
10
|
-
|
11
|
-
@copywritings-list @list
|
12
|
-
Scenario: Copywritings List
|
13
|
-
Given I have copywritings titled slogan, subtitle
|
14
|
-
When I go to the list of copywritings
|
15
|
-
Then I should see "slogan"
|
16
|
-
And I should see "subtitle"
|
17
|
-
|
18
|
-
@copywritings-edit @edit
|
19
|
-
Scenario: Edit Existing Copywriting
|
20
|
-
Given I have copywritings titled "slogan"
|
21
|
-
When I go to the list of copywritings
|
22
|
-
And I follow "Edit this copywriting" within ".actions"
|
23
|
-
Then I fill in "value" with "A different slogan"
|
24
|
-
And I press "Save"
|
25
|
-
Then I should see "'slogan' was successfully updated."
|
26
|
-
And I should be on the list of copywritings
|
27
|
-
And I should see "A different slogan"
|
28
|
-
|
29
|
-
@copywritings-delete @delete
|
30
|
-
Scenario: Delete Copywriting
|
31
|
-
Given I only have copywritings titled slogan
|
32
|
-
When I go to the list of copywritings
|
33
|
-
And I follow "Remove this phrase"
|
34
|
-
Then I should see "'slogan' was successfully removed."
|
35
|
-
And I should have 0 copywritings
|
36
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
Given /^I have no copywritings$/ do
|
2
|
-
Refinery::Copywriting::Phrase.delete_all
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I (only )?have copywritings titled "?([^\"]*)"?$/ do |only, titles|
|
6
|
-
Refinery::Copywriting::Phrase.delete_all if only
|
7
|
-
titles.split(', ').each do |title|
|
8
|
-
Refinery::Copywriting::Phrase.create(:name => title)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
Then /^I should have ([0-9]+) copywritings?$/ do |count|
|
13
|
-
Refinery::Copywriting::Phrase.count.should == count.to_i
|
14
|
-
end
|
data/features/support/paths.rb
DELETED