mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-14 08:50:44 +00:00
Added 2 hour start date overlap for calendar events
Added new NSL logo Change default gather passwords Explicitly add sprockets to the Gemfile
This commit is contained in:
parent
69213fc205
commit
ae6d146852
8 changed files with 50 additions and 14 deletions
1
Gemfile
1
Gemfile
|
@ -23,6 +23,7 @@ gem 'dynamic_form', '~> 1.1.4'
|
|||
gem 'country_code_select', '~> 1.0.1'
|
||||
gem 'rmagick', '~> 2.13.2', require: false
|
||||
|
||||
gem 'sprockets', '~> 2.2.1'
|
||||
gem 'tinymce-rails', '~> 3.5.9'
|
||||
gem 'jquery-rails', '~> 2.0.2'
|
||||
gem 'sass-rails', '~> 3.2.5'
|
||||
|
|
|
@ -290,6 +290,7 @@ DEPENDENCIES
|
|||
sass-rails (~> 3.2.5)
|
||||
selenium-webdriver (~> 2.41.0)
|
||||
simplecov (~> 0.7.1)
|
||||
sprockets (~> 2.2.1)
|
||||
therubyracer (~> 0.12.1)
|
||||
timecop (~> 0.7.1)
|
||||
tinymce-rails (~> 3.5.9)
|
||||
|
|
BIN
app/assets/images/logo.png
Normal file
BIN
app/assets/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
|
@ -15,7 +15,7 @@ div
|
|||
&#indexBanner
|
||||
width: 100%
|
||||
height: 194px
|
||||
background: no-repeat url('/images/index/index_header.png')
|
||||
background: image-url('logo.png') left -55px no-repeat
|
||||
position: relative
|
||||
|
||||
&#indexLogo
|
||||
|
|
|
@ -20,7 +20,7 @@ class GoogleCalendar
|
|||
|
||||
def upcoming
|
||||
events.select do |event|
|
||||
event.start >= Time.zone.now
|
||||
event.start >= (Time.zone.now - 2.hours)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<b>Voice Comunication:</b><br />
|
||||
- <%= link_to "Teamspeak 3", "http://www.teamspeak.com/?page=downloads" %> <br />
|
||||
- <b>Server:</b> <a href="ts3server://ensl.org">ensl.org</a><br />
|
||||
- <b>Password:</b> europe
|
||||
- <b>Password:</b> ns2nsl
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Google Calendar widget' do
|
||||
let(:time) { Time.zone.local(2014, 4, 1, 12, 0, 0) }
|
||||
let(:events_list_json) { JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) }
|
||||
let!(:user) { create(:user) }
|
||||
|
||||
before do
|
||||
Timecop.travel(time)
|
||||
|
||||
GoogleCalendar::Request.stub(:events_list) do
|
||||
GoogleCalendar::EventList.new(events_list_json, Time.zone.name)
|
||||
end
|
||||
|
@ -16,20 +13,57 @@ feature 'Google Calendar widget' do
|
|||
end
|
||||
|
||||
scenario 'the most recent upcoming event should appear correctly' do
|
||||
expect(first_event).to have_content("Div 2B: el'pheer vs. RadicaL")
|
||||
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
|
||||
|
||||
Timecop.travel(time) do
|
||||
visit root_path
|
||||
|
||||
expect(first_event).to have_content("Div 2B: el'pheer vs. RadicaL")
|
||||
end
|
||||
end
|
||||
|
||||
feature 'Timezones offsets' do
|
||||
scenario 'when a user is logged out, CEST is default' do
|
||||
expect(first_event).to have_content("20:30 CEST")
|
||||
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
|
||||
|
||||
Timecop.travel(time) do
|
||||
visit root_path
|
||||
|
||||
expect(first_event).to have_content("20:30 CEST")
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'when time has passed under 2 hours after the start date' do
|
||||
time = Time.zone.local(2014, 4, 4, 23, 59, 0)
|
||||
|
||||
Timecop.travel(time) do
|
||||
visit root_path
|
||||
|
||||
expect(first_event).to have_content("Div 3B: Mister vs. HBZ")
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'when time has passed over 2 hours after the start date' do
|
||||
time = Time.zone.local(2014, 4, 5, 0, 1, 0)
|
||||
|
||||
Timecop.travel(time) do
|
||||
visit root_path
|
||||
|
||||
expect(first_event).not_to have_content("Div 3B: Mister vs. HBZ")
|
||||
expect(first_event).to have_content("Div 3B: OMNOM vs. Mister")
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'when a user is logged in, their local timezone is used' do
|
||||
sign_in_as(user)
|
||||
change_timezone_for(user, timezone_us_east)
|
||||
visit root_path
|
||||
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
|
||||
|
||||
expect(first_event).to have_content(timezone_adjusted)
|
||||
Timecop.travel(time) do
|
||||
sign_in_as(user)
|
||||
change_timezone_for(user, timezone_us_east)
|
||||
visit root_path
|
||||
|
||||
expect(first_event).to have_content(timezone_adjusted)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ Capybara.register_driver :poltergeist do |app|
|
|||
Capybara::Poltergeist::Driver.new(app, :phantomjs_logger => File.open('/dev/null'))
|
||||
end
|
||||
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.javascript_driver = :selenium
|
||||
|
||||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
||||
|
||||
|
@ -30,7 +30,7 @@ RSpec.configure do |config|
|
|||
|
||||
config.before(:each) do
|
||||
if example.metadata[:type] == :feature
|
||||
Capybara.current_driver = :poltergeist
|
||||
Capybara.current_driver = :selenium
|
||||
else
|
||||
Capybara.use_default_driver
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue