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 'country_code_select', '~> 1.0.1'
gem 'rmagick', '~> 2.13.2', require: false gem 'rmagick', '~> 2.13.2', require: false
gem 'sprockets', '~> 2.2.1'
gem 'tinymce-rails', '~> 3.5.9' gem 'tinymce-rails', '~> 3.5.9'
gem 'jquery-rails', '~> 2.0.2' gem 'jquery-rails', '~> 2.0.2'
gem 'sass-rails', '~> 3.2.5' gem 'sass-rails', '~> 3.2.5'

View file

@ -290,6 +290,7 @@ DEPENDENCIES
sass-rails (~> 3.2.5) sass-rails (~> 3.2.5)
selenium-webdriver (~> 2.41.0) selenium-webdriver (~> 2.41.0)
simplecov (~> 0.7.1) simplecov (~> 0.7.1)
sprockets (~> 2.2.1)
therubyracer (~> 0.12.1) therubyracer (~> 0.12.1)
timecop (~> 0.7.1) timecop (~> 0.7.1)
tinymce-rails (~> 3.5.9) 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 &#indexBanner
width: 100% width: 100%
height: 194px height: 194px
background: no-repeat url('/images/index/index_header.png') background: image-url('logo.png') left -55px no-repeat
position: relative position: relative
&#indexLogo &#indexLogo

View file

@ -20,7 +20,7 @@ class GoogleCalendar
def upcoming def upcoming
events.select do |event| events.select do |event|
event.start >= Time.zone.now event.start >= (Time.zone.now - 2.hours)
end end
end end

View file

@ -88,7 +88,7 @@
<b>Voice Comunication:</b><br /> <b>Voice Comunication:</b><br />
- <%= link_to "Teamspeak 3", "http://www.teamspeak.com/?page=downloads" %> <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>Server:</b> <a href="ts3server://ensl.org">ensl.org</a><br />
- <b>Password:</b> europe - <b>Password:</b> ns2nsl
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -1,13 +1,10 @@
require 'spec_helper' require 'spec_helper'
feature 'Google Calendar widget' do 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(:events_list_json) { JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
before do before do
Timecop.travel(time)
GoogleCalendar::Request.stub(:events_list) do GoogleCalendar::Request.stub(:events_list) do
GoogleCalendar::EventList.new(events_list_json, Time.zone.name) GoogleCalendar::EventList.new(events_list_json, Time.zone.name)
end end
@ -16,15 +13,51 @@ feature 'Google Calendar widget' do
end end
scenario 'the most recent upcoming event should appear correctly' do scenario 'the most recent upcoming event should appear correctly' do
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") expect(first_event).to have_content("Div 2B: el'pheer vs. RadicaL")
end end
end
feature 'Timezones offsets' do feature 'Timezones offsets' do
scenario 'when a user is logged out, CEST is default' do scenario 'when a user is logged out, CEST is default' do
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") expect(first_event).to have_content("20:30 CEST")
end 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 scenario 'when a user is logged in, their local timezone is used' do
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
Timecop.travel(time) do
sign_in_as(user) sign_in_as(user)
change_timezone_for(user, timezone_us_east) change_timezone_for(user, timezone_us_east)
visit root_path visit root_path
@ -32,6 +65,7 @@ feature 'Google Calendar widget' do
expect(first_event).to have_content(timezone_adjusted) expect(first_event).to have_content(timezone_adjusted)
end end
end end
end
private private

View file

@ -14,7 +14,7 @@ Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, :phantomjs_logger => File.open('/dev/null')) Capybara::Poltergeist::Driver.new(app, :phantomjs_logger => File.open('/dev/null'))
end end
Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :selenium
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
@ -30,7 +30,7 @@ RSpec.configure do |config|
config.before(:each) do config.before(:each) do
if example.metadata[:type] == :feature if example.metadata[:type] == :feature
Capybara.current_driver = :poltergeist Capybara.current_driver = :selenium
else else
Capybara.use_default_driver Capybara.use_default_driver
end end