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:
Luke Barratt 2014-04-04 23:56:22 +01:00
parent 69213fc205
commit ae6d146852
8 changed files with 50 additions and 14 deletions

View file

@ -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'

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View file

@ -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

View file

@ -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

View file

@ -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>

View file

@ -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

View file

@ -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