ccs_core_gem 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/{service → services}/site_details_controller.rb +7 -6
- data/app/controllers/{service → services}/site_signups_controller.rb +5 -5
- data/app/controllers/services_controller.rb +5 -0
- data/app/helpers/service/site_details_helper.rb +2 -0
- data/app/helpers/service/site_signups_helper.rb +2 -0
- data/app/models/signup_service.rb +0 -1
- data/config/routes.rb +59 -7
- data/lib/ccs_core_gem/version.rb +1 -1
- data/lib/generators/ccs_core_gem/templates/services.yml +4 -4
- data/nbproject/private/rake-d.txt +3 -3
- data/test/fixtures/site_details.yml +15 -0
- data/test/fixtures/site_signups.yml +13 -0
- data/test/functional/services/site_details_controller_test.rb +49 -0
- data/test/functional/services/site_signups_controller_test.rb +54 -0
- data/test/functional/services_controller_test.rb +8 -0
- data/test/performance/browsing_test.rb +9 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/helpers/services/site_details_helper_test.rb +4 -0
- data/test/unit/helpers/services/site_signups_helper_test.rb +4 -0
- data/test/unit/helpers/services_helper_test.rb +4 -0
- data/test/unit/site_detail_test.rb +8 -0
- data/test/unit/site_signup_test.rb +8 -0
- metadata +21 -9
- data/app/helpers/application_helper.rb +0 -2
- data/app/helpers/service/site_detail_helper.rb +0 -2
- data/app/helpers/site_details_helper.rb +0 -2
- data/app/helpers/site_signups_helper.rb +0 -2
@@ -1,4 +1,6 @@
|
|
1
|
-
class
|
1
|
+
class Services::SiteDetailsController < ServicesController
|
2
|
+
# GET /site_details
|
3
|
+
# GET /site_details.xml
|
2
4
|
def index
|
3
5
|
@site_details = SiteDetail.all
|
4
6
|
|
@@ -42,8 +44,8 @@ class Service::SiteDetailsController < ServiceController
|
|
42
44
|
|
43
45
|
respond_to do |format|
|
44
46
|
if @site_detail.save
|
45
|
-
format.html { redirect_to([:
|
46
|
-
format.xml { render :xml => @site_detail, :status => :created, :location => [:
|
47
|
+
format.html { redirect_to([:services, @site_detail], :notice => 'Site detail was successfully created.') }
|
48
|
+
format.xml { render :xml => @site_detail, :status => :created, :location => [:services, @site_detail] }
|
47
49
|
else
|
48
50
|
format.html { render :action => "new" }
|
49
51
|
format.xml { render :xml => @site_detail.errors, :status => :unprocessable_entity }
|
@@ -58,7 +60,7 @@ class Service::SiteDetailsController < ServiceController
|
|
58
60
|
|
59
61
|
respond_to do |format|
|
60
62
|
if @site_detail.update_attributes(params[:site_detail])
|
61
|
-
format.html { redirect_to([:
|
63
|
+
format.html { redirect_to([:services, @site_detail], :notice => 'Site detail was successfully updated.') }
|
62
64
|
format.xml { head :ok }
|
63
65
|
else
|
64
66
|
format.html { render :action => "edit" }
|
@@ -74,9 +76,8 @@ class Service::SiteDetailsController < ServiceController
|
|
74
76
|
@site_detail.destroy
|
75
77
|
|
76
78
|
respond_to do |format|
|
77
|
-
format.html { redirect_to(
|
79
|
+
format.html { redirect_to(services_site_details_url) }
|
78
80
|
format.xml { head :ok }
|
79
81
|
end
|
80
82
|
end
|
81
|
-
|
82
83
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class Services::SiteSignupsController < ServicesController
|
2
2
|
# GET /site_signups
|
3
3
|
# GET /site_signups.xml
|
4
4
|
def index
|
@@ -44,8 +44,8 @@ class Service::SiteSignupsController < ServiceController
|
|
44
44
|
|
45
45
|
respond_to do |format|
|
46
46
|
if @site_signup.save
|
47
|
-
format.html { redirect_to([:
|
48
|
-
format.xml { render :xml => @site_signup, :status => :created, :location => [:
|
47
|
+
format.html { redirect_to([:services, @site_signup], :notice => 'Site signup was successfully created.') }
|
48
|
+
format.xml { render :xml => @site_signup, :status => :created, :location => [:services, @site_signup] }
|
49
49
|
else
|
50
50
|
format.html { render :action => "new" }
|
51
51
|
format.xml { render :xml => @site_signup.errors, :status => :unprocessable_entity }
|
@@ -60,7 +60,7 @@ class Service::SiteSignupsController < ServiceController
|
|
60
60
|
|
61
61
|
respond_to do |format|
|
62
62
|
if @site_signup.update_attributes(params[:site_signup])
|
63
|
-
format.html { redirect_to([:
|
63
|
+
format.html { redirect_to([:services, @site_signup], :notice => 'Site signup was successfully updated.') }
|
64
64
|
format.xml { head :ok }
|
65
65
|
else
|
66
66
|
format.html { render :action => "edit" }
|
@@ -76,7 +76,7 @@ class Service::SiteSignupsController < ServiceController
|
|
76
76
|
@site_signup.destroy
|
77
77
|
|
78
78
|
respond_to do |format|
|
79
|
-
format.html { redirect_to(
|
79
|
+
format.html { redirect_to(services_site_signups_url) }
|
80
80
|
format.xml { head :ok }
|
81
81
|
end
|
82
82
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'service_locator'
|
2
2
|
class SignupService < Service(:crm)
|
3
|
-
puts "@@@@ Site Detail count #{SiteDetail.count}"
|
4
3
|
site_type = SiteDetail.first.site_type unless SiteDetail.first.blank?
|
5
4
|
if site_type && (site_type == "community" || site_type == "ccslocal" || site_type == "ccsmain")
|
6
5
|
self.element_name = "ccslocal_site"
|
data/config/routes.rb
CHANGED
@@ -1,13 +1,65 @@
|
|
1
|
-
|
2
|
-
# resources :accounts, :controller => 'authr/accounts', :only => [:new, :create]
|
3
|
-
# CcsCore::Application.routes.draw do
|
1
|
+
CcsSiteDetails::Application.routes.draw do
|
4
2
|
|
5
|
-
# resources :site_signups
|
6
3
|
|
7
|
-
|
8
|
-
|
9
|
-
namespace :service do
|
4
|
+
namespace :services do
|
10
5
|
resources :site_details
|
11
6
|
resources :site_signups
|
12
7
|
end
|
8
|
+
|
9
|
+
# The priority is based upon order of creation:
|
10
|
+
# first created -> highest priority.
|
11
|
+
|
12
|
+
# Sample of regular route:
|
13
|
+
# match 'products/:id' => 'catalog#view'
|
14
|
+
# Keep in mind you can assign values other than :controller and :action
|
15
|
+
|
16
|
+
# Sample of named route:
|
17
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
18
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
19
|
+
|
20
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
21
|
+
# resources :products
|
22
|
+
|
23
|
+
# Sample resource route with options:
|
24
|
+
# resources :products do
|
25
|
+
# member do
|
26
|
+
# get 'short'
|
27
|
+
# post 'toggle'
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# collection do
|
31
|
+
# get 'sold'
|
32
|
+
# end
|
33
|
+
# end
|
34
|
+
|
35
|
+
# Sample resource route with sub-resources:
|
36
|
+
# resources :products do
|
37
|
+
# resources :comments, :sales
|
38
|
+
# resource :seller
|
39
|
+
# end
|
40
|
+
|
41
|
+
# Sample resource route with more complex sub-resources
|
42
|
+
# resources :products do
|
43
|
+
# resources :comments
|
44
|
+
# resources :sales do
|
45
|
+
# get 'recent', :on => :collection
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
|
49
|
+
# Sample resource route within a namespace:
|
50
|
+
# namespace :admin do
|
51
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
52
|
+
# # (app/controllers/admin/products_controller.rb)
|
53
|
+
# resources :products
|
54
|
+
# end
|
55
|
+
|
56
|
+
# You can have the root of your site routed with "root"
|
57
|
+
# just remember to delete public/index.html.
|
58
|
+
# root :to => "welcome#index"
|
59
|
+
|
60
|
+
# See how all your routes lay out with "rake routes"
|
61
|
+
|
62
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
63
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
64
|
+
# match ':controller(/:action(/:id(.:format)))'
|
13
65
|
end
|
data/lib/ccs_core_gem/version.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
development:
|
2
|
-
crm: http://
|
2
|
+
crm: http://username:password@localhost:3002/
|
3
3
|
site: https://cloudcitysites.com/
|
4
4
|
reports: localhost:3001/
|
5
5
|
|
6
6
|
production:
|
7
|
-
crm: https://
|
7
|
+
crm: https://username:password@cloudcityservices.com/
|
8
8
|
site: https://cloudcitysites.com/
|
9
9
|
reports: reports.example.com/
|
10
10
|
|
11
11
|
test:
|
12
|
-
crm: http://
|
12
|
+
crm: http://ausername:password@localhost:3002/
|
13
13
|
reports: reports.example.com/
|
14
14
|
|
15
15
|
cucumber:
|
16
|
-
crm: http://
|
16
|
+
crm: http://username:password@localhost:3002/
|
17
17
|
reports: reports.example.com/
|
@@ -1,3 +1,3 @@
|
|
1
|
-
build=Build ccs_core_gem-0.0.
|
2
|
-
install=Build and install ccs_core_gem-0.0.
|
3
|
-
release=Create tag v0.0.
|
1
|
+
build=Build ccs_core_gem-0.0.3.gem into the pkg directory
|
2
|
+
install=Build and install ccs_core_gem-0.0.3.gem into system gems
|
3
|
+
release=Create tag v0.0.3 and build and push ccs_core_gem-0.0.3.gem to Rubygems
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
one:
|
4
|
+
site_id: 1
|
5
|
+
site_url: MyString
|
6
|
+
paypal_email_address: MyString
|
7
|
+
owner_ip_address: MyString
|
8
|
+
site_type: MyString
|
9
|
+
|
10
|
+
two:
|
11
|
+
site_id: 1
|
12
|
+
site_url: MyString
|
13
|
+
paypal_email_address: MyString
|
14
|
+
owner_ip_address: MyString
|
15
|
+
site_type: MyString
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Services::SiteDetailsControllerTest < ActionController::TestCase
|
4
|
+
setup do
|
5
|
+
@site_detail = site_details(:one)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "should get index" do
|
9
|
+
get :index
|
10
|
+
assert_response :success
|
11
|
+
assert_not_nil assigns(:site_details)
|
12
|
+
end
|
13
|
+
|
14
|
+
test "should get new" do
|
15
|
+
get :new
|
16
|
+
assert_response :success
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should create site_detail" do
|
20
|
+
assert_difference('SiteDetail.count') do
|
21
|
+
post :create, :site_detail => @site_detail.attributes
|
22
|
+
end
|
23
|
+
|
24
|
+
assert_redirected_to services_site_detail_path(assigns(:site_detail))
|
25
|
+
end
|
26
|
+
|
27
|
+
test "should show site_detail" do
|
28
|
+
get :show, :id => @site_detail.to_param
|
29
|
+
assert_response :success
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should get edit" do
|
33
|
+
get :edit, :id => @site_detail.to_param
|
34
|
+
assert_response :success
|
35
|
+
end
|
36
|
+
|
37
|
+
test "should update site_detail" do
|
38
|
+
put :update, :id => @site_detail.to_param, :site_detail => @site_detail.attributes
|
39
|
+
assert_redirected_to services_site_detail_path(assigns(:site_detail))
|
40
|
+
end
|
41
|
+
|
42
|
+
test "should destroy site_detail" do
|
43
|
+
assert_difference('SiteDetail.count', -1) do
|
44
|
+
delete :destroy, :id => @site_detail.to_param
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_redirected_to services_site_details_path
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Services::SiteSignupsControllerTest < ActionController::TestCase
|
4
|
+
setup do
|
5
|
+
@site_signup = site_signups(:one)
|
6
|
+
@update = {
|
7
|
+
:email_address => 'test@fluffypaws.co.uk',
|
8
|
+
:name => 'test',
|
9
|
+
:requested_url => 'testsite'
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
test "should get index" do
|
14
|
+
get :index
|
15
|
+
assert_response :success
|
16
|
+
assert_not_nil assigns(:site_signups)
|
17
|
+
end
|
18
|
+
|
19
|
+
test "should get new" do
|
20
|
+
get :new
|
21
|
+
assert_response :success
|
22
|
+
end
|
23
|
+
|
24
|
+
test "should create site_signup" do
|
25
|
+
assert_difference('SiteSignup.count') do
|
26
|
+
post :create, :site_signup => @site_signup.attributes
|
27
|
+
end
|
28
|
+
|
29
|
+
assert_redirected_to services_site_signup_path(assigns(:site_signup))
|
30
|
+
end
|
31
|
+
|
32
|
+
test "should show site_signup" do
|
33
|
+
get :show, :id => @site_signup.to_param
|
34
|
+
assert_response :success
|
35
|
+
end
|
36
|
+
|
37
|
+
test "should get edit" do
|
38
|
+
get :edit, :id => @site_signup.to_param
|
39
|
+
assert_response :success
|
40
|
+
end
|
41
|
+
|
42
|
+
test "should update site_signup" do
|
43
|
+
put :update, :id => @site_signup.to_param, :site_signup => @site_signup.attributes
|
44
|
+
assert_redirected_to services_site_signup_path(assigns(:site_signup))
|
45
|
+
end
|
46
|
+
|
47
|
+
test "should destroy site_signup" do
|
48
|
+
assert_difference('SiteSignup.count', -1) do
|
49
|
+
delete :destroy, :id => @site_signup.to_param
|
50
|
+
end
|
51
|
+
|
52
|
+
assert_redirected_to services_site_signups_path
|
53
|
+
end
|
54
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
3
|
+
require 'rails/test_help'
|
4
|
+
|
5
|
+
class ActiveSupport::TestCase
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
7
|
+
#
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
+
# -- they do not yet inherit this setting
|
10
|
+
fixtures :all
|
11
|
+
|
12
|
+
# Add more helper methods to be used by all tests here...
|
13
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ccs_core_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James West
|
@@ -32,13 +32,13 @@ files:
|
|
32
32
|
- .gitignore
|
33
33
|
- Gemfile
|
34
34
|
- Rakefile
|
35
|
-
- app/controllers/
|
36
|
-
- app/controllers/service/site_signups_controller.rb
|
35
|
+
- app/controllers/application_controller.rb
|
37
36
|
- app/controllers/service_controller.rb
|
38
|
-
- app/
|
39
|
-
- app/
|
40
|
-
- app/
|
41
|
-
- app/helpers/
|
37
|
+
- app/controllers/services/site_details_controller.rb
|
38
|
+
- app/controllers/services/site_signups_controller.rb
|
39
|
+
- app/controllers/services_controller.rb
|
40
|
+
- app/helpers/service/site_details_helper.rb
|
41
|
+
- app/helpers/service/site_signups_helper.rb
|
42
42
|
- app/models/signup_service.rb
|
43
43
|
- app/models/site_detail.rb
|
44
44
|
- app/models/site_signup.rb
|
@@ -74,6 +74,18 @@ files:
|
|
74
74
|
- nbproject/private/rake-d.txt
|
75
75
|
- nbproject/project.properties
|
76
76
|
- nbproject/project.xml
|
77
|
+
- test/fixtures/site_details.yml
|
78
|
+
- test/fixtures/site_signups.yml
|
79
|
+
- test/functional/services/site_details_controller_test.rb
|
80
|
+
- test/functional/services/site_signups_controller_test.rb
|
81
|
+
- test/functional/services_controller_test.rb
|
82
|
+
- test/performance/browsing_test.rb
|
83
|
+
- test/test_helper.rb
|
84
|
+
- test/unit/helpers/services/site_details_helper_test.rb
|
85
|
+
- test/unit/helpers/services/site_signups_helper_test.rb
|
86
|
+
- test/unit/helpers/services_helper_test.rb
|
87
|
+
- test/unit/site_detail_test.rb
|
88
|
+
- test/unit/site_signup_test.rb
|
77
89
|
has_rdoc: true
|
78
90
|
homepage: http://www.ccslocal.com
|
79
91
|
licenses: []
|