Skip to content

Commit

Permalink
Merge branch 'release-2.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Reis committed Dec 17, 2018
2 parents 5d5caa6 + f3c3d2a commit 6d021d2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/partials/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ul strong {
text-align: left;

a {
color: $white !important;
color: $white;
}

}
Expand Down
16 changes: 12 additions & 4 deletions app/assets/stylesheets/subdomains/_kclibrary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
color: $kc-blue !important;
}

.footer-primary {
color: $kc-grey;
}

&.login-new,
&.sessions-new,
&.registrations-new {
Expand All @@ -28,6 +24,18 @@
color: $kc-blue;
}

.cms_nav {
color: $kc-grey;

.cms_nav--link {
color: $kc-grey !important;
}
}

.license {
color: $kc-grey;
}

.course-widget.completed header {
background: linear-gradient(to bottom, $kc-blue 0%, $kc-blue 100%);
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/_new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% if @library_card_login %>
<div class="form-group">
<%= label_tag "login_library_card_number", "Library Card Number", class: "screen-reader-text" %>
<%= f.email_field :login, autofocus: true, id: "login_email", placeholder: "#{t('login_signup.library_card_number')} *" %>
<%= f.text_field :login, autofocus: true, id: "login_library_card_number", placeholder: "#{t('login_signup.library_card_number')} *" %>
</div>

<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<strong>LEARN MORE</strong>
<% if @footer_pages %>
<% @footer_pages.each do |page| %>
<li><%= link_to page.title, cms_page_path(page) %></li>
<li><%= link_to page.title, cms_page_path(page), class: "cms_nav--link" %></li>
<% end %>
<% end %>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_ga_kclibrary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

var userGaId = $("#user_ga_id").val();
ga('create', 'UA-37972615-5', 'auto', {
ga('create', 'UA-37972615-12', 'auto', {
userId: userGaId
});

Expand Down
16 changes: 16 additions & 0 deletions spec/feature_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,36 @@
require "selenium/webdriver"
require "webmock/rspec"


# TODO: Consolidate these 4 methods into one method with keyword args, maybe?
def log_in_with(email, password, admin = nil)
visit new_user_session_path(admin: admin)
find("#login_email").set(email)
find("#login_password").set(password)
click_button "Access Courses"
end

def library_card_log_in_with(card_number, password)
visit new_user_session_path
find("#login_library_card_number").set(card_number)
find("#login_password").set(password)
click_button "Access Courses"
end

def spanish_log_in_with(email, password)
visit new_user_session_path
find("#login_email").set(email)
find("#login_password").set(password)
click_button "Accesar Cursos"
end

def spanish_library_card_log_in_with(card_number, password)
visit new_user_session_path
find("#login_library_card_number").set(card_number)
find("#login_password").set(password)
click_button "Accesar Cursos"
end

def log_out
click_link "Sign Out"
end
Expand Down
10 changes: 5 additions & 5 deletions spec/features/user_logs_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

user = User.last

log_in_with(card_number, card_pin)
library_card_log_in_with(card_number, card_pin)
expect(current_path).to eq(root_path)
expect(page).to_not have_content("Signed in successfully.")
expect(page).to have_content("Use a computer to do almost anything!")
Expand All @@ -164,13 +164,13 @@
end

scenario "with invalid library card number" do
log_in_with("12345", user.library_card_pin)
library_card_log_in_with("12345", user.library_card_pin)
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content("Invalid Library Card Number or Library Card PIN")
end

scenario "with invalid pin" do
log_in_with(user.library_card_number, "123")
library_card_log_in_with(user.library_card_number, "123")
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content("Invalid Library Card Number or Library Card PIN")
end
Expand All @@ -189,13 +189,13 @@
end

scenario "with invalid library card number" do
spanish_log_in_with("12345", user.library_card_pin)
spanish_library_card_log_in_with("12345", user.library_card_pin)
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content("Número de tarjeta de biblioteca o PIN de tarjeta de biblioteca no válidos")
end

scenario "with invalid pin" do
spanish_log_in_with(user.library_card_number, "123")
spanish_library_card_log_in_with(user.library_card_number, "123")
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content("Número de tarjeta de biblioteca o PIN de tarjeta de biblioteca no válidos")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/user_visits_profile_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
@spanish = create(:spanish_lang)
# English gets created from factories
user.update(sign_in_count: 2) # To prevent first time sign in events
log_in_with(user.library_card_number, user.library_card_pin)
library_card_log_in_with(user.library_card_number, user.library_card_pin)
end

scenario "can view their account options" do
Expand Down

0 comments on commit 6d021d2

Please sign in to comment.