smarter_listing 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/smarter_listing/copy.js.erb +1 -1
- data/app/views/smarter_listing/create.js.erb +1 -1
- data/app/views/smarter_listing/edit.js.erb +1 -1
- data/app/views/smarter_listing/new.js.erb +1 -1
- data/app/views/smarter_listing/update.js.erb +1 -1
- data/lib/smarter_listing/version.rb +1 -1
- data/test/controllers/listings_controller_test.rb +17 -4
- data/test/dummy/app/views/layouts/default.html.erb +1 -1
- data/test/dummy/app/views/listings/_form.html.erb +1 -1
- data/test/dummy/app/views/listings/_table_header.html.erb +2 -1
- data/test/dummy/app/views/listings/index.html.erb +1 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +8736 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 327a347c94717d1f2311f0001a0aa527c365a713
|
4
|
+
data.tar.gz: b639ec9b44082b24ea6c46e6be279ddd0bf494c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d9f752feacad0d5477e4b24446d5d1e5551228383ab0e7abd2f802520aab14cd246e428e9a9156e35d7f438420f017046632542246ad4b96a4afbbe798fa6d0
|
7
|
+
data.tar.gz: f3b9e075f5a74d103fc9158353cd51ddc4f644075af391cc8879f146d0225718a89a06b172fd89fc768a4bae22eaa55c6b60c9cd9079e1f2bb13ab5736dda2f6
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= smart_listing_item collection_sym, :copy, resource, "#{current_engine}/#{collection_sym}/form" %>
|
1
|
+
<%= smart_listing_item collection_sym, :copy, resource, "#{current_engine}/#{collection_sym}/form.html" %>
|
2
2
|
<%== render 'smarter_listing/form_logic' %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= smart_listing_item collection_sym, :create, resource, resource.valid? ? "#{current_engine}/#{collection_sym}/#{collection_action}" : "#{current_engine}/#{collection_sym}/form" %>
|
1
|
+
<%= smart_listing_item collection_sym, :create, resource, resource.valid? ? "#{current_engine}/#{collection_sym}/#{collection_action}" : "#{current_engine}/#{collection_sym}/form.html" %>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= smart_listing_item collection_sym, :edit, resource, "#{current_engine}/#{collection_sym}/form" %>
|
1
|
+
<%= smart_listing_item collection_sym, :edit, resource, "#{current_engine}/#{collection_sym}/form.html" %>
|
2
2
|
<%== render 'smarter_listing/form_logic' %>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= smart_listing_item collection_sym, :new, resource, "#{current_engine}/#{collection_sym}/form" %>
|
1
|
+
<%= smart_listing_item collection_sym, :new, resource, "#{current_engine}/#{collection_sym}/form.html" %>
|
2
2
|
<%== render 'smarter_listing/form_logic' %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= smart_listing_item collection_sym, :update, resource, resource.valid? ? "#{current_engine}/#{collection_sym}/#{collection_action}" : "#{current_engine}/#{collection_sym}/form" %>
|
1
|
+
<%= smart_listing_item collection_sym, :update, resource, resource.valid? ? "#{current_engine}/#{collection_sym}/#{collection_action}" : "#{current_engine}/#{collection_sym}/form.html" %>
|
@@ -11,6 +11,7 @@ class ListingsControllerTest < ActionController::TestCase
|
|
11
11
|
test 'correct layout' do
|
12
12
|
get :index
|
13
13
|
assert_template 'default'
|
14
|
+
assert_select '#layout', 'TAG'
|
14
15
|
end
|
15
16
|
|
16
17
|
test 'should have the methods from all helpers' do
|
@@ -24,12 +25,19 @@ class ListingsControllerTest < ActionController::TestCase
|
|
24
25
|
test "should get index" do
|
25
26
|
get :index
|
26
27
|
assert_response :success
|
27
|
-
|
28
|
+
assert_equal [@listing], assigns(:listings)
|
29
|
+
assert_select '#this_is_the_index', 'TAG'
|
30
|
+
assert_select 'table#the_table'
|
31
|
+
assert_select 'td', @listing.name
|
32
|
+
assert_select 'td', @listing.content
|
33
|
+
assert_select 'td.actions', 1
|
28
34
|
end
|
29
35
|
|
30
36
|
test "should get new" do
|
31
37
|
xhr :get, :new, format: :js
|
32
38
|
assert_response :success
|
39
|
+
assert_equal 'text/javascript', @response.content_type
|
40
|
+
assert_includes response.body, 'id=\\"the_form\\"'
|
33
41
|
end
|
34
42
|
|
35
43
|
test "should create listing" do
|
@@ -41,22 +49,27 @@ class ListingsControllerTest < ActionController::TestCase
|
|
41
49
|
assert_response :success
|
42
50
|
end
|
43
51
|
|
44
|
-
test
|
52
|
+
test 'should get edit' do
|
45
53
|
xhr :get, :edit, id: @listing, format: :js
|
46
54
|
assert_response :success
|
55
|
+
assert_equal 'text/javascript', @response.content_type
|
56
|
+
assert_includes response.body, 'id=\\"the_form\\"'
|
47
57
|
end
|
48
58
|
|
49
|
-
test
|
59
|
+
test 'should update listing' do
|
50
60
|
resource_params = {content: @listing.content, deleted_at: @listing.deleted_at, name: 'newName'}
|
51
61
|
xhr :patch, :update, id: @listing, listing: resource_params, format: :js
|
52
62
|
assert_empty @listing.errors
|
53
63
|
assert_response :success
|
64
|
+
assert_includes response.body, '<td>newName<\\/td>'
|
65
|
+
assert_includes response.body, @listing.content
|
54
66
|
end
|
55
67
|
|
56
|
-
test
|
68
|
+
test 'should destroy listing' do
|
57
69
|
assert_difference('Listing.count', -1) do
|
58
70
|
xhr :delete, :destroy, id: @listing, format: :js
|
59
71
|
end
|
60
72
|
assert_response :success
|
73
|
+
assert_select 'tr', 0
|
61
74
|
end
|
62
75
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
-
<table class="table table-striped">
|
1
|
+
<table class="table table-striped" id="the_table">
|
2
2
|
<tr>
|
3
3
|
<th><%= smart_listing.sortable 'Name', :name %></th>
|
4
4
|
<th><%= smart_listing.sortable 'Content', :content %></th>
|
5
|
+
</tr>
|
5
6
|
<% smart_listing.collection.each do |lang| %>
|
6
7
|
<tr class="editable" data-id="<%= lang.id %>">
|
7
8
|
<%= smart_listing.render partial: 'listing', locals: {object: lang} %>
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|