calagator 0.0.1.pre1 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → MIT-LICENSE.txt} +0 -0
- data/README.md +4 -18
- data/Rakefile +6 -0
- data/app/assets/javascripts/calagator.js +1 -0
- data/app/assets/stylesheets/calagator/changes.scss +45 -0
- data/app/assets/stylesheets/calagator/errors.css +8 -0
- data/app/assets/stylesheets/calagator/forms.scss +148 -2
- data/app/assets/stylesheets/calagator/index.scss +21 -0
- data/app/assets/stylesheets/calagator/layout.scss +731 -0
- data/app/assets/stylesheets/calagator/mobile.scss +196 -0
- data/app/assets/stylesheets/calagator/{reset.css → reset.scss} +0 -0
- data/app/assets/stylesheets/calagator/typography.scss +225 -0
- data/app/assets/stylesheets/calagator/{common.scss → utils.scss} +0 -0
- data/app/assets/stylesheets/calagator/variables.scss +21 -0
- data/app/controllers/calagator/admin_controller.rb +1 -1
- data/app/controllers/calagator/application_controller.rb +3 -3
- data/app/controllers/calagator/events_controller.rb +3 -3
- data/app/controllers/calagator/site_controller.rb +1 -1
- data/app/controllers/calagator/sources_controller.rb +3 -3
- data/app/controllers/calagator/venues_controller.rb +4 -4
- data/app/controllers/calagator/versions_controller.rb +2 -2
- data/app/helpers/calagator/application_helper.rb +0 -3
- data/app/helpers/calagator/mapping_helper.rb +9 -8
- data/app/models/calagator/event.rb +2 -3
- data/app/models/calagator/event/ical_renderer.rb +4 -2
- data/app/models/calagator/event/saver.rb +2 -2
- data/app/models/calagator/event/search_engine/sql.rb +2 -1
- data/app/models/calagator/source.rb +0 -26
- data/app/models/calagator/source/importer.rb +1 -1
- data/app/models/calagator/source/parser/meetup.rb +2 -2
- data/app/models/calagator/venue.rb +0 -2
- data/app/models/calagator/venue/geocoder.rb +1 -1
- data/app/models/calagator/venue/search_engine/sql.rb +1 -1
- data/app/views/calagator/events/_subnav.html.erb +2 -2
- data/app/views/calagator/events/show.html.erb +2 -2
- data/app/views/calagator/site/_description.html.erb +6 -3
- data/app/views/calagator/site/_sidebar_menu.html.erb +13 -0
- data/app/views/calagator/site/index.html.erb +1 -0
- data/app/views/calagator/sources/index.html.erb +1 -1
- data/app/views/calagator/sources/show.html.erb +1 -1
- data/app/views/calagator/venues/_subnav.html.erb +1 -1
- data/app/views/calagator/venues/show.html.erb +1 -1
- data/app/views/layouts/calagator/_after_footer.html.erb +2 -0
- data/app/views/layouts/calagator/_content.html.erb +6 -0
- data/app/views/layouts/calagator/_footer.html.erb +8 -0
- data/app/views/layouts/calagator/_global_search.html.erb +11 -0
- data/app/views/layouts/calagator/_header.html.erb +20 -0
- data/app/views/layouts/calagator/application.html.erb +9 -64
- data/config/routes.rb +16 -16
- data/config/spring.rb +1 -0
- data/db/development +0 -0
- data/db/development.sqlite3 +0 -0
- data/db/migrate/20150407014752_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +14 -0
- data/db/migrate/20150407014754_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +9 -0
- data/db/schema.rb +2 -8
- data/db/seeds.rb +64 -8
- data/lib/calagator.rb +42 -2
- data/lib/calagator/duplicate_checking/duplicate_finder.rb +1 -1
- data/lib/calagator/duplicate_checking/duplicate_squasher.rb +1 -1
- data/lib/calagator/engine.rb +12 -22
- data/lib/calagator/tag_model_extensions.rb +1 -1
- data/lib/calagator/version.rb +1 -1
- data/lib/generators/calagator/install_generator.rb +17 -12
- data/lib/generators/calagator/templates/config/initializers/01_calagator.rb +89 -0
- data/lib/generators/calagator/templates/config/initializers/02_geokit.rb +106 -0
- data/lib/tasks/sunspot_reindex_calagator.rake +16 -3
- data/lib/tasks/update_counter_caches.rake +3 -3
- data/spec/controllers/calagator/events_controller_spec.rb +3 -3
- data/spec/controllers/calagator/sources_controller_spec.rb +3 -3
- data/spec/controllers/calagator/venues_controller_spec.rb +5 -5
- data/spec/dummy/Gemfile +35 -27
- data/spec/dummy/README.rdoc +15 -248
- data/spec/dummy/Rakefile +1 -2
- data/spec/dummy/app/assets/javascripts/application.js +5 -4
- data/spec/dummy/app/assets/stylesheets/application.css +6 -4
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/views/layouts/application.html.erb +2 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +2 -2
- data/spec/dummy/config/application.rb +5 -41
- data/spec/dummy/config/boot.rb +1 -4
- data/spec/dummy/config/database.yml +8 -8
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/01_calagator.rb +89 -0
- data/spec/dummy/config/initializers/02_geokit.rb +106 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/spec/dummy/config/locales/en.yml +20 -2
- data/spec/dummy/config/routes.rb +23 -25
- data/spec/dummy/config/secrets.yml +16 -77
- data/spec/dummy/config/sunspot.yml +23 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +31 -30
- data/spec/dummy/db/seeds.rb +1 -0
- data/spec/dummy/log/development.log +257 -235
- data/spec/dummy/public/404.html +54 -13
- data/spec/dummy/public/422.html +54 -13
- data/spec/dummy/public/500.html +53 -12
- data/spec/dummy/public/robots.txt +2 -2
- data/spec/dummy/test/test_helper.rb +2 -5
- data/spec/factories.rb +0 -54
- data/spec/features/admin_auth_spec.rb +2 -2
- data/spec/features/admin_lock_event_spec.rb +1 -1
- data/spec/features/import_events_from_feed_spec.rb +1 -1
- data/spec/helpers/calagator/google_event_export_helper_spec.rb +8 -11
- data/spec/helpers/calagator/sources_helper_spec.rb +1 -2
- data/spec/helpers/calagator/tags_helper_spec.rb +1 -2
- data/spec/models/calagator/event_spec.rb +7 -7
- data/spec/models/calagator/source/parser_meetup_spec.rb +3 -3
- data/spec/models/calagator/source_spec.rb +0 -29
- data/spec/models/calagator/venue_spec.rb +8 -11
- data/spec/spec_helper.rb +3 -1
- data/spec/support/admin_authentication.rb +2 -0
- data/spec/support/assert_dom_equal.rb +26 -0
- data/spec/support/paper_trail.rb +7 -0
- data/spec/support/rspec-activemodel-mocks_patch.rb +9 -0
- metadata +200 -280
- data/app/assets/stylesheets/calagator.scss +0 -8
- data/app/assets/stylesheets/calagator/datepicker.scss +0 -177
- data/app/assets/stylesheets/calagator/theme.css +0 -0
- data/app/models/event/search_engine/base.rb +0 -0
- data/config/deploy/local.rb +0 -37
- data/config/deploy/lucca.rb +0 -33
- data/config/initializers/geokit.rb +0 -74
- data/config/initializers/search_engine.rb +0 -4
- data/config/initializers/set_default_url_host.rb +0 -5
- data/db/test.sqlite3 +0 -0
- data/lib/generators/calagator/templates/config/calagator.rb +0 -26
- data/lib/generators/calagator/templates/config/secrets.yml.sample +0 -83
- data/lib/secrets_reader.rb +0 -76
- data/spec/dummy/Gemfile.lock +0 -195
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/config/initializers/calagator.rb +0 -26
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/db/migrate/20150309023304_create_events.calagator.rb +0 -18
- data/spec/dummy/db/migrate/20150309023305_create_venues.calagator.rb +0 -18
- data/spec/dummy/db/migrate/20150309023306_create_sources.calagator.rb +0 -17
- data/spec/dummy/db/migrate/20150309023307_add_detailed_fields_to_venue.calagator.rb +0 -20
- data/spec/dummy/db/migrate/20150309023308_add_end_time_to_events.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023309_add_source_id_to_events.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023310_add_source_id_to_venues.calagator.rb +0 -11
- data/spec/dummy/db/migrate/20150309023311_add_duplicate_of_column_to_venues.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023312_add_duplicate_of_column_to_events.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023313_change_lat_long_type.calagator.rb +0 -13
- data/spec/dummy/db/migrate/20150309023314_add_source_reimport.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023315_change_end_time_to_duration.calagator.rb +0 -12
- data/spec/dummy/db/migrate/20150309023316_remove_format_type_from_source.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023317_create_updates.calagator.rb +0 -16
- data/spec/dummy/db/migrate/20150309023318_remove_next_update_from_source.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023319_change_duration_to_end_time.calagator.rb +0 -12
- data/spec/dummy/db/migrate/20150309023320_create_tags_and_taggings.calagator.rb +0 -29
- data/spec/dummy/db/migrate/20150309023321_create_versioned_events.calagator.rb +0 -26
- data/spec/dummy/db/migrate/20150309023322_create_versioned_venues.calagator.rb +0 -33
- data/spec/dummy/db/migrate/20150309023323_add_rrule_to_events.calagator.rb +0 -16
- data/spec/dummy/db/migrate/20150309023324_create_versions.calagator.rb +0 -19
- data/spec/dummy/db/migrate/20150309023325_add_closed_flag_to_venues.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023326_add_wifi_flag_to_venues.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023327_add_access_notes_to_venues.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023328_add_events_count_to_venues.calagator.rb +0 -9
- data/spec/dummy/db/migrate/20150309023329_add_venue_details_to_events.calagator.rb +0 -10
- data/spec/dummy/db/migrate/20150309023330_acts_as_taggable_on_migration.calagator.rb +0 -51
- data/spec/dummy/db/migrate/20150309023331_cleanup.calagator.rb +0 -15
- data/spec/dummy/db/migrate/20150309023332_specify_venues_latitude_and_longitude_precision.calagator.rb +0 -12
- data/spec/dummy/db/migrate/20150309023333_remove_updates.calagator.rb +0 -14
- data/spec/dummy/db/migrate/20150309023334_add_locked_status_to_events.calagator.rb +0 -6
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/doc/README_FOR_APP +0 -2
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/test/performance/browsing_test.rb +0 -12
- data/spec/lib/secrets_reader_spec.rb +0 -65
data/spec/dummy/public/404.html
CHANGED
@@ -2,25 +2,66 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
16
54
|
</style>
|
17
55
|
</head>
|
18
56
|
|
19
57
|
<body>
|
20
58
|
<!-- This file lives in public/404.html -->
|
21
59
|
<div class="dialog">
|
22
|
-
<
|
23
|
-
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
24
65
|
</div>
|
25
66
|
</body>
|
26
67
|
</html>
|
data/spec/dummy/public/422.html
CHANGED
@@ -2,25 +2,66 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
16
54
|
</style>
|
17
55
|
</head>
|
18
56
|
|
19
57
|
<body>
|
20
58
|
<!-- This file lives in public/422.html -->
|
21
59
|
<div class="dialog">
|
22
|
-
<
|
23
|
-
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
24
65
|
</div>
|
25
66
|
</body>
|
26
67
|
</html>
|
data/spec/dummy/public/500.html
CHANGED
@@ -2,24 +2,65 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
16
54
|
</style>
|
17
55
|
</head>
|
18
56
|
|
19
57
|
<body>
|
20
58
|
<!-- This file lives in public/500.html -->
|
21
59
|
<div class="dialog">
|
22
|
-
<
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
23
64
|
</div>
|
24
65
|
</body>
|
25
66
|
</html>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
# See http://www.robotstxt.org/
|
1
|
+
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
2
2
|
#
|
3
3
|
# To ban all spiders from the entire site uncomment the next two lines:
|
4
|
-
# User-
|
4
|
+
# User-agent: *
|
5
5
|
# Disallow: /
|
@@ -1,12 +1,9 @@
|
|
1
|
-
ENV[
|
1
|
+
ENV['RAILS_ENV'] ||= 'test'
|
2
2
|
require File.expand_path('../../config/environment', __FILE__)
|
3
3
|
require 'rails/test_help'
|
4
4
|
|
5
5
|
class ActiveSupport::TestCase
|
6
|
-
# Setup all fixtures in test/fixtures/*.
|
7
|
-
#
|
8
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
9
|
-
# -- they do not yet inherit this setting
|
6
|
+
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
10
7
|
fixtures :all
|
11
8
|
|
12
9
|
# Add more helper methods to be used by all tests here...
|
data/spec/factories.rb
CHANGED
@@ -36,58 +36,4 @@ FactoryGirl.define do
|
|
36
36
|
factory :duplicate_event, parent: :event do
|
37
37
|
association :duplicate_of, factory: :event
|
38
38
|
end
|
39
|
-
|
40
|
-
factory :seed_venue, parent: :venue do
|
41
|
-
title { Faker::Company.name }
|
42
|
-
description { Faker::Lorem.paragraph }
|
43
|
-
address { "#{Faker::Address.street_address},
|
44
|
-
#{Faker::Address.city},
|
45
|
-
#{Faker::Address.state}
|
46
|
-
#{Faker::Address.zip_code}" }
|
47
|
-
street_address { Faker::Address.street_address }
|
48
|
-
locality { Faker::Address.city }
|
49
|
-
region { Faker::Address.state }
|
50
|
-
postal_code { [Faker::Address.zip_code, Faker::Address.postcode].sample }
|
51
|
-
country { Faker::Address.country }
|
52
|
-
latitude { Faker::Address.latitude }
|
53
|
-
longitude { Faker::Address.longitude }
|
54
|
-
email { Faker::Internet.email }
|
55
|
-
telephone { Faker::PhoneNumber.phone_number }
|
56
|
-
url { Faker::Internet.url }
|
57
|
-
closed { [false, true].sample }
|
58
|
-
wifi { [true, false].sample }
|
59
|
-
access_notes Faker::Lorem.paragraph
|
60
|
-
|
61
|
-
trait :with_events do
|
62
|
-
after(:create) do | seed_venue |
|
63
|
-
create_list(:seed_event, 3, venue_id: seed_venue.id)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
factory :seed_event, parent: :event do
|
70
|
-
from = 2.years.ago
|
71
|
-
to = 2.years.from_now
|
72
|
-
|
73
|
-
title { Faker::Lorem.sentence }
|
74
|
-
description { Faker::Lorem.paragraph }
|
75
|
-
start_time {
|
76
|
-
[
|
77
|
-
Faker::Time.between(2.years.ago, 2.years.from_now),
|
78
|
-
Faker::Time.backward(1, :all),
|
79
|
-
Faker::Time.forward(1, :all),
|
80
|
-
Faker::Time.forward(7, :all)
|
81
|
-
].sample
|
82
|
-
}
|
83
|
-
created_at { start_time - 1.days }
|
84
|
-
end_time { start_time + 3.hours }
|
85
|
-
|
86
|
-
trait :with_venue do
|
87
|
-
before(:create) do |seed_event|
|
88
|
-
venue = create(:seed_venue)
|
89
|
-
seed_event.venue_id = venue.id
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
39
|
end
|
@@ -13,9 +13,9 @@ feature 'Administrative suite is hidden behind an http basic auth wall' do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
scenario "Authenticated users are permitted in #{path}" do
|
16
|
-
page.driver.basic_authorize
|
16
|
+
page.driver.basic_authorize Calagator.admin_username, Calagator.admin_password
|
17
17
|
visit path
|
18
|
-
|
18
|
+
expect([200, 304]).to include page.status_code
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -6,7 +6,7 @@ feature 'Event locking' do
|
|
6
6
|
create :event, title: 'Ruby Newbies', start_time: Time.zone.now
|
7
7
|
create :event, title: 'Ruby Privateers', start_time: Time.zone.now, locked: true
|
8
8
|
|
9
|
-
page.driver.basic_authorize
|
9
|
+
page.driver.basic_authorize Calagator.admin_username, Calagator.admin_password
|
10
10
|
|
11
11
|
visit '/admin'
|
12
12
|
click_on 'Lock events'
|
@@ -4,6 +4,8 @@ module Calagator
|
|
4
4
|
|
5
5
|
describe GoogleEventExportHelper, :type => :helper do
|
6
6
|
describe "google_event_export_link" do
|
7
|
+
let(:params) { Rack::Utils.parse_query(@export) }
|
8
|
+
|
7
9
|
def escape(string)
|
8
10
|
return Regexp.escape(CGI.escape(string))
|
9
11
|
end
|
@@ -18,24 +20,19 @@ describe GoogleEventExportHelper, :type => :helper do
|
|
18
20
|
|
19
21
|
shared_examples_for "exported event" do
|
20
22
|
it "should have title" do
|
21
|
-
|
23
|
+
params["text"].should == @event.title
|
22
24
|
end
|
23
25
|
|
24
26
|
it "should have time range in utc" do
|
25
|
-
dates = Rack::Utils.parse_query(@export)["dates"]
|
26
27
|
format = "%Y%m%dT%H%M%SZ"
|
27
|
-
dates.should == [
|
28
|
+
params["dates"].should == [
|
28
29
|
@event.start_time.utc.strftime(format),
|
29
30
|
@event.end_time.utc.strftime(format),
|
30
31
|
].join("/")
|
31
32
|
end
|
32
33
|
|
33
|
-
it "should have venue title" do
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should have venue address" do
|
38
|
-
expect(@export).to match /\&location=.+?#{escape(@event.venue.geocode_address)}/
|
34
|
+
it "should have venue title and address" do
|
35
|
+
params["location"].should == "#{@event.venue.title}, #{@event.venue.geocode_address}"
|
39
36
|
end
|
40
37
|
end
|
41
38
|
|
@@ -46,7 +43,7 @@ describe GoogleEventExportHelper, :type => :helper do
|
|
46
43
|
it_should_behave_like "exported event"
|
47
44
|
|
48
45
|
it "should have a complete event description" do
|
49
|
-
|
46
|
+
params["details"].should include event_description
|
50
47
|
end
|
51
48
|
end
|
52
49
|
|
@@ -57,7 +54,7 @@ describe GoogleEventExportHelper, :type => :helper do
|
|
57
54
|
it_should_behave_like "exported event"
|
58
55
|
|
59
56
|
it "should have a truncated event description" do
|
60
|
-
|
57
|
+
params["details"].should include event_description[0..100]
|
61
58
|
end
|
62
59
|
|
63
60
|
it "should have a truncated URL" do
|
@@ -4,9 +4,8 @@ describe Calagator::SourcesHelper, :type => :helper do
|
|
4
4
|
describe "#source_url_link" do
|
5
5
|
it "returns an unspiderable link that opens in a new window" do
|
6
6
|
source = double(url: "http://google.com")
|
7
|
-
expect(helper.source_url_link(source)).to
|
7
|
+
expect(helper.source_url_link(source)).to match_dom_of \
|
8
8
|
%(<a href="http://google.com" rel="nofollow" target="_BLANK">http://google.com</a>)
|
9
|
-
)
|
10
9
|
end
|
11
10
|
end
|
12
11
|
end
|
@@ -6,10 +6,9 @@ describe TagsHelper, type: :helper do
|
|
6
6
|
describe "#tag_links_for" do
|
7
7
|
it "renders tag links for the supplied model" do
|
8
8
|
event = FactoryGirl.create(:event, tag_list: %w(b a))
|
9
|
-
expect(tag_links_for(event)).to
|
9
|
+
expect(tag_links_for(event)).to match_dom_of \
|
10
10
|
%(<a href="/events/tag/a" class="p-category">a</a>, ) +
|
11
11
|
%(<a href="/events/tag/b" class="p-category">b</a>)
|
12
|
-
)
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
@@ -265,7 +265,7 @@ describe Event, :type => :model do
|
|
265
265
|
|
266
266
|
it "should set from Date" do
|
267
267
|
event = Event.new(:start_time => Date.parse("2009-02-01"))
|
268
|
-
expect(event.start_time).to eq Time.parse("2009-02-01")
|
268
|
+
expect(event.start_time).to eq Time.zone.parse("2009-02-01")
|
269
269
|
end
|
270
270
|
|
271
271
|
it "should set from DateTime" do
|
@@ -303,7 +303,7 @@ describe Event, :type => :model do
|
|
303
303
|
|
304
304
|
it "should set from Date" do
|
305
305
|
event = Event.new(:end_time => Date.parse("2009-02-01"))
|
306
|
-
expect(event.end_time).to eq Time.parse("2009-02-01")
|
306
|
+
expect(event.end_time).to eq Time.zone.parse("2009-02-01")
|
307
307
|
end
|
308
308
|
|
309
309
|
it "should set from DateTime" do
|
@@ -600,12 +600,12 @@ describe Event, :type => :model do
|
|
600
600
|
end
|
601
601
|
|
602
602
|
it "should find complete duplicates by all" do
|
603
|
-
pre, post = find_duplicates_create_a_clone_and_find_again(:all, @event.attributes)
|
603
|
+
pre, post = find_duplicates_create_a_clone_and_find_again(:all, @event.attributes.merge(id: nil))
|
604
604
|
expect(post.size).to eq(pre.size + 2)
|
605
605
|
end
|
606
606
|
|
607
607
|
it "should not find incomplete duplicates by all" do
|
608
|
-
pre, post = find_duplicates_create_a_clone_and_find_again(:all, @event.attributes.merge(:
|
608
|
+
pre, post = find_duplicates_create_a_clone_and_find_again(:all, @event.attributes.merge(title: "SpaceCube", start_time: @event.start_time, id: nil))
|
609
609
|
expect(post.size).to eq pre.size
|
610
610
|
end
|
611
611
|
|
@@ -628,7 +628,7 @@ describe Event, :type => :model do
|
|
628
628
|
it "should consolidate associations, and merge tags" do
|
629
629
|
@event.tag_list = %w[first second] # master event contains one duplicate tag, and one unique tag
|
630
630
|
|
631
|
-
clone = Event.create!(@event.attributes)
|
631
|
+
clone = Event.create!(@event.attributes.merge(id: nil))
|
632
632
|
clone.tag_list.replace %w[second third] # duplicate event also contains one duplicate tag, and one unique tag
|
633
633
|
clone.save!
|
634
634
|
clone.reload
|
@@ -828,8 +828,8 @@ describe Event, :type => :model do
|
|
828
828
|
expect(ical.sequence).to eq 2
|
829
829
|
end
|
830
830
|
|
831
|
-
# it "should offset the squence based the global
|
832
|
-
#
|
831
|
+
# it "should offset the squence based the global Calagator.icalendar_sequence_offset" do
|
832
|
+
# Calagator.should_receive(:icalendar_sequence_offset).and_return(41)
|
833
833
|
# event = FactoryGirl.build(:event)
|
834
834
|
# ical = event_to_ical(event)
|
835
835
|
# ical.sequence.should eq 42
|