Skip to content

Commit

Permalink
Merge branch 'dev' into 421_group_color_ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
GoesOnTangents committed Feb 9, 2017
2 parents 8aafdc9 + ba770cb commit 849102b
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 10 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -122,6 +122,7 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'rspec-rails', '~> 3.2'
gem 'rspec-steps', '~> 2.1.1'
gem 'capybara', '~> 2.5'
gem 'poltergeist'
gem 'database_cleaner'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Expand Up @@ -235,6 +235,10 @@ GEM
ref (2.0.0)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
Expand All @@ -251,6 +255,8 @@ GEM
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-steps (2.1.1)
rspec (>= 3.0, < 3.99)
rspec-support (3.5.0)
rubocop (0.29.1)
astrolabe (~> 1.3)
Expand Down Expand Up @@ -361,6 +367,7 @@ DEPENDENCIES
redcarpet
ref
rspec-rails (~> 3.2)
rspec-steps (~> 2.1.1)
rubocop (~> 0.29.1)
rubyzip
simplecov
Expand Down
Expand Up @@ -310,4 +310,5 @@ strong, b {
.relative-box {
position: relative;

}
}

37 changes: 37 additions & 0 deletions app/assets/stylesheets/events.css
Expand Up @@ -54,12 +54,45 @@
transition: all 0.5s;
}

.event-preview a.btn-success{
color: #fff;
transition: all 0.5s;
}

.event-preview a.btn-danger{
color: #fff;
transition: all 0.5s;
}

.event-preview a.btn-default{
color: #000;
transition: all 0.5s;
}

.event-preview a:hover {
text-decoration: none;
color: #DE6207;
transition: all 0.5s;
}

.event-preview a.btn-success:hover {
text-decoration: none;
color: #fff;
transition: all 0.5s;
}

.event-preview a.btn-danger:hover {
text-decoration: none;
color: #fff;
transition: all 0.5s;
}

.event-preview a.btn-default:hover {
text-decoration: none;
color: #000;
transition: all 0.5s;
}

.front-section:nth-child(even) .event-preview {
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
Expand Down Expand Up @@ -118,3 +151,7 @@
height: 150px;
margin-bottom: 15px;
}

#event-date-pickers a.close {
color: #000;
}
10 changes: 5 additions & 5 deletions app/views/events/_form.html.erb
Expand Up @@ -5,11 +5,11 @@
<div class="form-group">
<%= f.label :type, :class => 'control-label col-lg-2' %>
<div class="btn-group col-lg-10" data-toggle="buttons">
<label class="btn btn-default <%= 'active' if not @event.hidden %>">
<label class="btn btn-default <%= 'active' if not @event.hidden %>" id="public_type">
<%= f.radio_button :hidden, false %>
<%= I18n.t :"events.type.public" %>
</label>
<label class="btn btn-default <%= 'active' if @event.hidden %>">
<label class="btn btn-default <%= 'active' if @event.hidden %>" id="private_type">
<%= f.radio_button :hidden, true %>
<%= I18n.t :"events.type.private" %>
</label>
Expand All @@ -19,11 +19,11 @@
<div class="form-group">
<%= f.label :published, :class => 'control-label col-lg-2' %>
<div class="btn-group col-lg-10" data-toggle="buttons">
<label class="btn btn-default <%= 'active' if not @event.published %>">
<label class="btn btn-default <%= 'active' if not @event.published %>" id="save_draft_option">
<%= f.radio_button :published, false %>
<%= I18n.t :"events.form.draft.save" %>
</label>
<label class="btn btn-default <%= 'active' if @event.published %>">
<label class="btn btn-default <%= 'active' if @event.published %>" id="publish_event_option">
<%= f.radio_button :published, true %>
<%= I18n.t :"events.form.draft.publish" %>
</label>
Expand Down Expand Up @@ -113,7 +113,7 @@
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<% if @event.new_record? %>
<%= f.submit t('.create'), :name => 'create', :class => 'btn btn-primary' %>
<%= f.submit t('.create'), :name => 'create', :class => 'btn btn-primary', :id => 'create_event' %>
<% else %>
<%= f.submit t('.update'), :name => 'update', :class => 'btn btn-primary' %>
<% end %>
Expand Down
3 changes: 1 addition & 2 deletions app/views/events/index.html.erb
Expand Up @@ -3,11 +3,10 @@
<h1><%=t '.title', :default => model_class.model_name.human(:count => model_class.count).titleize %></h1>
<p class="lead"><%= t('start_page.intro_text_events') %></p>
</div>

<div class="row">
<div class="event-list col-md-10 col-md-offset-1">
<div class="clearfix">
<%= link_to new_event_path, :class => 'btn btn-primary pull-right' do
<%= link_to new_event_path, :class => 'btn btn-primary pull-right', :id => 'new_event' do
glyph('plus') + ' ' +
t('.new', :default => t('helpers.links.new'))
end if can? :new, Event %>
Expand Down
3 changes: 1 addition & 2 deletions config/locales/de.yml
Expand Up @@ -47,10 +47,9 @@ de:
remember_me: "Eingeloggt bleiben"
midnight: "Mitternacht"
start_page:
welcome_to: "Herzlich willkommen im"
welcome_to: "Herzlich Willkommen im"
workshop_portal_hpi_html: "Workshop<div class='row spacer-15'></div>Portal des HPI."
register_now: "Registrieren"
welcome: "Herzlich Willkommen"
place_request: "Anfrage stellen"
all_events: 'Alle Veranstaltungen'
intro_text_html: "Bist Du interessiert an IT-Systems-Engineering, Design Thinking oder Entrepreneurship? Dann bist Du hier bei uns genau richtig. Hier findest du spannende Camps und Workshops des Hasso-Plattner-Instituts für Schülerinnen und Schüler sowie Berufstätige, die eine Abwechslung zum normalen Alltag suchen.<br>Schau doch mal bei uns vorbei!"
Expand Down
67 changes: 67 additions & 0 deletions spec/features/interactions/standard_interaction_spec.rb
@@ -0,0 +1,67 @@
require 'rails_helper'
require './db/sample_data/users'
require './db/sample_data'

RSpec::Steps.steps "Demo" do
before(:all) do
Rails.application.load_seed
add_sample_data
end

it "should show the welcome page on startup" do
visit root_path
expect(page).to have_text I18n.t('start_page.welcome_to')
end

it 'should let an organizer log in' do
#TODO: Use id instead of visible string, currently id is missing for login button
click_link I18n.t('navbar.login')
login_with_credentials(user_organizer.email, user_password)
expect(page).to_not have_text I18n.t('devise.failure.inactive')
expect(page).to_not have_text I18n.t('devise.failure.invalid')
expect(page).to_not have_text I18n.t('devise.failure.not_found_in_database')
expect(page).to_not have_text I18n.t('devise.failure.locked')
expect(page).to have_text I18n.t('devise.sessions.signed_in')
end

it 'should let organizer click the new event button' do
click_link I18n.t('navbar.events')
click_link 'new_event'
end

it 'should let organizer fill out event creation page', js: true do
choose I18n.t "events.type.public"
choose I18n.t "events.form.draft.publish"
fill_in 'event_name', with: 'BwInf-Camp'
fill_in 'description', with: '[von hpi website geklaut]'
fill_in 'event_max_participants', with: 25
fill_in "event[date_ranges_attributes][][start_date]", with: I18n.l(Date.new(2019, 01, 20))
fill_in "event[date_ranges_attributes][][end_date]", with: I18n.l(Date.new(2019, 01, 22))
fill_in 'event_organizer', with: 'HPI Schülerklub'
fill_in 'event_knowledge_level', with: 'Fortgeschrittene'
fill_in 'event_application_deadline', with: I18n.l(Date.new(2019, 01, 12))
#TODO: Add custom variable application fields
click_button 'create_event'
expect(page).to_not have_text I18n.t('errors.form_invalid.one')
expect(page).to_not have_text I18n.t('errors.form_invalid.other')
end
end

def logout(displayed_name)
#TODO: Use id instead of visible string, currently id is missing for dropdown
click_link displayed_name
click_link I18n.t('navbar.logout')
end

def login_with_credentials(email, password)
fill_in 'login_email', with: email
fill_in 'login_password', with: password
click_button 'login_submit'
end

def sign_up(email, password)
fill_in 'sign_up_email', with: email
fill_in 'sign_up_password', with: password
fill_in 'sign_up_password_confirmation', with: password
click_button 'sign_up_submit'
end

0 comments on commit 849102b

Please sign in to comment.