ProMotion 2.0.0.rc4 → 2.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ProMotion/stubs/dummy_view.rb +7 -0
- data/lib/ProMotion/table/extensions/indexable.rb +1 -1
- data/lib/ProMotion/table/table.rb +1 -1
- data/lib/ProMotion/version.rb +1 -1
- data/spec/functional/func_screen_spec.rb +2 -2
- data/spec/functional/func_split_screen_spec.rb +1 -1
- data/spec/functional/func_table_screen_spec.rb +1 -9
- data/spec/unit/tab_bar_spec.rb +8 -8
- data/spec/unit/tables/table_indexable_spec.rb +13 -0
- data/spec/unit/tables/table_screen_spec.rb +29 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b745b9285361e5c83902ad54555b26eb25ef64
|
4
|
+
data.tar.gz: 3efb5c16c82d9f136dde950742724cc4713b1d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ee92756d4cafbbe466cc4e03e8bf9a136c89335d961e69d61b0553473b96e0313179ddd4179995ad58d738b3d4cd6d0e5861ee6d5ec02902ca6dce6e55b5d74
|
7
|
+
data.tar.gz: abce7aecfb21cb8ca89bef8c0af872307bf18b278cb89ffc51bafb98329d5b2133f73fd83087cb2fa039c220e13bd8e90e38ec9fcc7b4608a8c0f11cc2a055d3
|
@@ -4,7 +4,7 @@ module ProMotion
|
|
4
4
|
def table_data_index
|
5
5
|
return nil if self.promotion_table_data.filtered || !self.class.get_indexable
|
6
6
|
|
7
|
-
index = self.promotion_table_data.sections.collect{ |section| section[:title][0] }
|
7
|
+
index = self.promotion_table_data.sections.collect{ |section| (section[:title] || " ")[0] } || []
|
8
8
|
index.unshift("{search}") if self.class.get_searchable
|
9
9
|
index
|
10
10
|
end
|
@@ -188,7 +188,7 @@ module ProMotion
|
|
188
188
|
return index unless ["{search}", UITableViewIndexSearch].include?(self.table_data_index[0])
|
189
189
|
|
190
190
|
if index == 0
|
191
|
-
tableView.
|
191
|
+
tableView.scrollRectToVisible(CGRectMake(0.0, 0.0, 1.0, 1.0), animated:false)
|
192
192
|
NSNotFound
|
193
193
|
else
|
194
194
|
index - 1
|
data/lib/ProMotion/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
describe "ProMotion::Screen
|
1
|
+
describe "ProMotion::Screen functionality" do
|
2
2
|
tests PM::Screen
|
3
3
|
|
4
4
|
# Override controller to properly instantiate
|
@@ -44,7 +44,7 @@ describe "ProMotion::Screen functional" do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should push another screen with animation by default" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe "ProMotion::
|
1
|
+
describe "ProMotion::TableScreen functionality" do
|
2
2
|
tests PM::TestTableScreen
|
3
3
|
|
4
4
|
def table_screen
|
@@ -120,14 +120,6 @@ describe "ProMotion::TestTableScreen functionality" do
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
-
it "should call the method with arguments when the switch is flipped" do
|
124
|
-
table_screen.scroll_to_bottom
|
125
|
-
tap "switch_2"
|
126
|
-
wait 0.3 do
|
127
|
-
table_screen.tap_counter.should == 3
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
123
|
it "should not crash if cell with editing_style is swiped left" do
|
132
124
|
Proc.new { flick("Just another deletable blank row", to: :left) }.should.not.raise(StandardError)
|
133
125
|
end
|
data/spec/unit/tab_bar_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe "PM::Tabs" do
|
|
9
9
|
@screen2 = BasicScreen.new(nav_bar: true, title: "Screen 2")
|
10
10
|
@screen3 = BasicScreen.new(title: "Screen 3")
|
11
11
|
@screen4 = BasicScreen.new(title: "Screen 4")
|
12
|
-
|
12
|
+
|
13
13
|
app.open_tab_bar(@screen1, @screen2, @screen3, @screen4)
|
14
14
|
end
|
15
15
|
end
|
@@ -18,18 +18,18 @@ describe "PM::Tabs" do
|
|
18
18
|
tab_bar
|
19
19
|
app.window.rootViewController.should.be.kind_of UITabBarController
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
it "should have four tabs" do
|
23
23
|
tab_bar.viewControllers.length.should == 4
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
it "should have the right screens in the right places" do
|
27
27
|
tab_bar.viewControllers[0].should == @screen1.navigationController
|
28
28
|
tab_bar.viewControllers[1].should == @screen2.navigationController
|
29
29
|
tab_bar.viewControllers[2].should == @screen3
|
30
30
|
tab_bar.viewControllers[3].should == @screen4
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
it "should allow opening a tab by the name from any screen" do
|
34
34
|
@screen1.open_tab "Screen 2"
|
35
35
|
tab_bar.selectedIndex.should == 1
|
@@ -51,7 +51,7 @@ describe "PM::Tabs" do
|
|
51
51
|
@screen4.open_tab 0
|
52
52
|
tab_bar.selectedIndex.should == 0
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
it "should allow opening a tab from the app_delegate" do
|
56
56
|
app.open_tab "Screen 2"
|
57
57
|
tab_bar.selectedIndex.should == 1
|
@@ -62,7 +62,7 @@ describe "PM::Tabs" do
|
|
62
62
|
app.open_tab "Screen 1"
|
63
63
|
tab_bar.selectedIndex.should == 0
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
it "should allow opening a tab by accessing the tab bar directly" do
|
67
67
|
tab_bar.open_tab "Screen 2"
|
68
68
|
tab_bar.selectedIndex.should == 1
|
@@ -73,7 +73,7 @@ describe "PM::Tabs" do
|
|
73
73
|
tab_bar.open_tab "Screen 1"
|
74
74
|
tab_bar.selectedIndex.should == 0
|
75
75
|
end
|
76
|
-
|
77
|
-
|
76
|
+
|
77
|
+
|
78
78
|
|
79
79
|
end
|
@@ -11,6 +11,19 @@ describe "PM::Table module indexable" do
|
|
11
11
|
|
12
12
|
end
|
13
13
|
|
14
|
+
describe "PM::Table module indexable with nil section title" do
|
15
|
+
|
16
|
+
before do
|
17
|
+
@screen = TableScreenIndexableNil.new
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should not crash when a section title is nil" do
|
21
|
+
result = %w{ A G M O S U }
|
22
|
+
@screen.sectionIndexTitlesForTableView(@screen.table_view).should == result.push(" ")
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
14
27
|
describe "PM::Table module indexable/searchable" do
|
15
28
|
|
16
29
|
before do
|
@@ -111,5 +111,34 @@ describe "table screens" do
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
|
+
describe "test PM::TableScreen's updating functionality" do
|
115
|
+
before do
|
116
|
+
class UpdateTestTableScreen < PM::TableScreen
|
117
|
+
def table_data; @table_data ||= []; end
|
118
|
+
def on_load
|
119
|
+
@table_data = [{cells: []}]
|
120
|
+
update_table_data
|
121
|
+
end
|
122
|
+
|
123
|
+
def make_more_cells
|
124
|
+
@table_data = [{cells: [{title: "Cell 1"},{title: "Cell 2"}]}]
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'should update the table data when update_table_data is called' do
|
130
|
+
@screen = UpdateTestTableScreen.new
|
131
|
+
@screen.tableView(@screen.tableView, numberOfRowsInSection:0).should == 0
|
132
|
+
@screen.make_more_cells
|
133
|
+
|
134
|
+
# We made them, but they shouldn't be in the table yet.
|
135
|
+
@screen.tableView(@screen.tableView, numberOfRowsInSection:0).should == 0
|
136
|
+
|
137
|
+
@screen.update_table_data
|
138
|
+
@screen.tableView(@screen.tableView, numberOfRowsInSection:0).should == 2
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
114
143
|
end
|
115
144
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: methadone
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- lib/ProMotion/screen/screen.rb
|
114
114
|
- lib/ProMotion/screen/screen_module.rb
|
115
115
|
- lib/ProMotion/screen/screen_navigation.rb
|
116
|
+
- lib/ProMotion/stubs/dummy_view.rb
|
116
117
|
- lib/ProMotion/styling/styling.rb
|
117
118
|
- lib/ProMotion/table/cell/table_view_cell_module.rb
|
118
119
|
- lib/ProMotion/table/data/table_data.rb
|