Skip to content

Commit

Permalink
Merge pull request #3883 from mattlindsey/3806_tests
Browse files Browse the repository at this point in the history
Restore some tests
  • Loading branch information
mattlindsey authored Apr 30, 2023
2 parents ebe0c11 + cd14148 commit 580f4b7
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 81 deletions.
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def prefix
end

def supported_third_parties
%w(github gplus)
%w(github)
# %w(github gplus)
end

def valid_email?(email)
Expand Down
4 changes: 2 additions & 2 deletions app/views/events/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<%= link_to 'Edit hangout link', '#', remote: true, data: {toggle: 'collapse', target: '#edit-link-form'}, role: 'menuitem', tabindex: '-1' %>
</li>
<li role="edit_yt_link">
<%= link_to 'Edit youtube link', '#', remote: true, data: {toggle: 'collapse', target: '#edit-yt-link-form'}, role: 'menuitem', tabindex: '-1' %>
<%= link_to 'Edit streaming link', '#', remote: true, data: {toggle: 'collapse', target: '#edit-yt-link-form'}, role: 'menuitem', tabindex: '-1' %>
</li>
</ul>
</div>
Expand Down Expand Up @@ -182,7 +182,7 @@
<b>Youtube Link</b>
<div class="form-group">
<div class="col-sm-8">
<input type="url" required class="form-control" name="yt_url" placeholder="Copy and paste the youtube link in here.." value="<%= @recent_hangout.try!(:yt_url) %>">
<input type="url" required class="form-control" name="yt_url" placeholder="Copy and paste the streaming link in here.." value="<%= @recent_hangout.try!(:yt_url) %>">
</div>
<div class="col-sm-2">
<button type="button" class="form-control btn-default" data-toggle="collapse" data-target="#edit-yt-link-form" id="yt_link_cancel">Cancel</button>
Expand Down
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ features:
sender: '"Error Police" <[email protected]>'
exception_recipients: ['[email protected]']
disqus:
enabled: true
enabled: false
welcome_email:
enabled: true
twitter:
Expand Down
2 changes: 2 additions & 0 deletions config/settings/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ features:
twitter:
notifications:
enabled: <%= ENV['TWITTER_NOTIFICATIONS_ENABLED'] %>
disqus:
enabled: false

api:
premium_subscriptions_token: <%= ENV['PREMIUM_SUBSCRIPTIONS_API_TOKEN'] %>
Expand Down
12 changes: 6 additions & 6 deletions features/events/client_meetings.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Feature: Provide a ClientMeeting Category
| EdX | greetings earthlings | | active | 2795 |
| AAA | for roadists | | active | |

# @javascript
# Scenario: Show Client Meeting event
# Given the date is "2014/02/03 07:01:00 UTC"
# And I am on Events index page
# Then I should see "ClientMtg"
# And I should see "11:00-13:30 (UTC)"
@javascript
Scenario: Show Client Meeting event
Given the date is "2014/02/03 07:01:00 UTC"
And I am on Events index page
Then I should see "ClientMtg"
And I should see "11:00-13:30 (CUT)"

@javascript
Scenario: Create Client Meeting event
Expand Down
6 changes: 3 additions & 3 deletions features/events/create_events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Feature: Events
Given the event "Whatever"
Then I should be on the event "Show" page for "Whatever"
And the event named "Whatever" is associated with "EdX"
# And I should see "09:00-09:30 (UTC)"
And I should see "09:00-09:30 (CUT) UTC"
Then they should see a link to the creator of the event

@javascript
Expand All @@ -59,7 +59,7 @@ Feature: Events
Given the event "Whatever"
Then I should be on the event "Show" page for "Whatever"
And the event named "Whatever" is associated with "EdX"
# And I should see "09:00-09:30 (UTC)"
And I should see "09:00-09:30 (CUT) UTC"
Then they should see a link to the creator of the event
And I should see "for: Associate Members"

Expand All @@ -74,7 +74,7 @@ Feature: Events
And I click the "Save" button
Then I should see "Event Created"
And I should be on the event "Show" page for "Whatever"
# And I should see "19:00-19:30 (UTC)"
And I should see "19:00-19:30 (CUT) UTC"

Scenario: Projects should be ordered alphabetically
Then the dropdown with id "event_project_id" should only have active projects
Expand Down
2 changes: 1 addition & 1 deletion features/events/edit_future_event.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Editing an event with a start date in the future
And I select "Repeat ends" to "never"
And I click the "Save" button
Then I should be on the event "Show" page for "Daily Standup"
# And I should see "09:00-09:30 (UTC)"
And I should see "09:00-09:30 (CUT) UTC"
And I visit the edit page for the event named "Daily Standup"
Then the "Repeat ends" selector should be set to "never"

Expand Down
2 changes: 1 addition & 1 deletion features/events/edit_past_event.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Editing an event with start date in the past
And I select "Repeat ends" to "never"
And I click the "Save" button
Then I should be on the event "Show" page for "Daily Standup"
# And I should see "09:00-09:30 (UTC)"
# And I should see "09:00-09:30 (CUT) UTC"
And I visit the edit page for the event named "Daily Standup"
Then the "Repeat ends" selector should be set to "never"

Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/hangout_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def set_event_start_date(event_ins, num)
yt_url = "https://youtu.be/#{yt_id}"
visit event_path(Event.find_by_name(event_name))
page.find(:css, '#actions-dropdown').trigger('click')
page.find_link('Edit youtube link').trigger('click')
page.find_link('Edit streaming link').trigger('click')
expect(page).to have_field('yt_url', with: yt_url)
end

Expand Down
28 changes: 14 additions & 14 deletions features/users/omniauth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Feature: Connect to social sites
When I click "with GitHub"
Then I should see "Signed in successfully."

@omniauth
Scenario: Log in with Google account
When I click "with Google"
Then I should see "Signed in successfully."
# @omniauth
# Scenario: Log in with Google account
# When I click "with Google"
# Then I should see "Signed in successfully."

# @omniauth-with-invalid-credentials
# Scenario: Try to log in with invalid credentials
Expand All @@ -31,16 +31,16 @@ Feature: Connect to social sites
# Then I should see "invalid_credentials"
# And I should be signed out

@omniauth
Scenario: redirect to the last visited page after login with Google
Given I exist as a user
And I visit "/users/sign_in"
And I click "with Google"
And I am not logged in
And I am on Events index page
And I visit "/users/sign_in"
When I click "with Google"
Then I should be on the Events "Index" page
# @omniauth
# Scenario: redirect to the last visited page after login with Google
# Given I exist as a user
# And I visit "/users/sign_in"
# And I click "with Google"
# And I am not logged in
# And I am on Events index page
# And I visit "/users/sign_in"
# When I click "with Google"
# Then I should be on the Events "Index" page

@omniauth
Scenario: redirect to the last visited page after login with Github
Expand Down
18 changes: 9 additions & 9 deletions features/users/sign_in.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ Feature: Sign in
When I sign in with valid credentials
Then I should be on the Events "Index" page

@omniauth
Scenario: User is deactivated
Given I exist as a user signed up via google
And I am not logged in
And I have deactivated my account
And I am on the "Sign in" page
And I click "Google"
Then I see a user deactivated message
And I should be signed out
# @omniauth
# Scenario: User is deactivated
# Given I exist as a user signed up via google
# And I am not logged in
# And I have deactivated my account
# And I am on the "Sign in" page
# And I click "Google"
# Then I see a user deactivated message
# And I should be signed out
70 changes: 35 additions & 35 deletions features/users/sign_up.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: As a developer
And the user "[email protected]" should have karma
And I should see a successful sign up message
And I should receive a "Welcome to AgileVentures.org" email
And replies to that email should go to "info@agileventures.org"
And replies to that email should go to "matt@agileventures.org"

Scenario: User signs up successfully with no consent for mailings
When I sign up with valid user data
Expand Down Expand Up @@ -60,46 +60,46 @@ Scenario: User signs up successfully giving consent for mailings
And the page should contain the google adwords conversion code
And I should be on the "getting started" page

@omniauth
Scenario: User signs up with a Google account
Given I am on the "registration" page
When I click "Google"
Then I should see "Signed in successfully."
And the page should contain the google adwords conversion code
And I should be on the "getting started" page
# @omniauth
# Scenario: User signs up with a Google account
# Given I am on the "registration" page
# When I click "Google"
# Then I should see "Signed in successfully."
# And the page should contain the google adwords conversion code
# And I should be on the "getting started" page

@omniauth-without-email
Scenario: User signs up with a GitHub account having no public email (sad path)
Given I am on the "registration" page
When I sign up with GitHub
Then I should see link for instructions to sign up

@omniauth-without-email
Scenario: User signs up with a Google account having no public email (sad path)
Given I am on the "registration" page
When I click "Google"
Then I should see the "google" icon
Then I should see "Your Gplus account needs to have a public email address for sign up"
And I should not see "Password can't be blank"
# @omniauth-without-email
# Scenario: User signs up with a Google account having no public email (sad path)
# Given I am on the "registration" page
# When I click "Google"
# Then I should see the "google" icon
# Then I should see "Your Gplus account needs to have a public email address for sign up"
# And I should not see "Password can't be blank"

@omniauth
Scenario: User is deactivated and tries to sign up again with google
Given I exist as a user signed up via google
And I am not logged in
And I have deactivated my account
And I am on the "registration" page
And I click "Google"
Then I see a user deactivated message
And I should be signed out
# @omniauth
# Scenario: User is deactivated and tries to sign up again with google
# Given I exist as a user signed up via google
# And I am not logged in
# And I have deactivated my account
# And I am on the "registration" page
# And I click "Google"
# Then I see a user deactivated message
# And I should be signed out

@omniauth
Scenario: User is deactivated and tries to sign up again with email
Given I exist as a user signed up via google
And I am not logged in
And I have deactivated my account
And I am on the "registration" page
And I submit "[email protected]" as username
And I submit "password" as password
And I click "Sign up" button
Then I see a user deactivated message
And I should be signed out
# @omniauth
# Scenario: User is deactivated and tries to sign up again with email
# Given I exist as a user signed up via google
# And I am not logged in
# And I have deactivated my account
# And I am on the "registration" page
# And I submit "[email protected]" as username
# And I submit "password" as password
# And I click "Sign up" button
# Then I see a user deactivated message
# And I should be signed out
8 changes: 4 additions & 4 deletions spec/mailers/mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
let(:plan) { instance_double(Plan, name: 'Premium', free_trial_length_days: 7, free_trial?: true, category: nil) }
it 'is expected to send payment complete message' do
mail = Mailer.send_premium_payment_complete(plan, '[email protected]')
expect(mail.from).to include('info@agileventures.org')
expect(mail.reply_to).to include('info@agileventures.org')
expect(mail.from).to include('matt@agileventures.org')
expect(mail.reply_to).to include('matt@agileventures.org')
expect(mail.to).to include('[email protected]')
expect(mail.subject).to include('Welcome to AgileVentures Premium')
expect(mail.body.raw_source).to include('Thanks for signing up for AgileVentures Premium!')
Expand All @@ -24,8 +24,8 @@

it 'is expected to send welcome message' do
mail = Mailer.send_welcome_message(@user)
expect(mail.from).to include('info@agileventures.org')
expect(mail.reply_to).to include('info@agileventures.org')
expect(mail.from).to include('matt@agileventures.org')
expect(mail.reply_to).to include('matt@agileventures.org')
expect(mail.to).to include('[email protected]')
expect(mail.subject).to include('Welcome to AgileVentures.org')
expect(mail.body.raw_source).to include('Welcome!')
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/authentications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

RSpec.describe 'OmniAuth authentication', type: :feature do
supported_auths = {
'github' => 'GitHub',
'gplus' => 'Google'
'github' => 'GitHub'
# 'gplus' => 'Google'
}

before do
Expand Down Expand Up @@ -99,7 +99,7 @@
expect(page).to have_content('Successfully removed profile.')
end

xit 'should be able to create other profiles' do
it 'should be able to create other profiles' do
supported_auths.each do |p, n|
next if p == provider

Expand Down

0 comments on commit 580f4b7

Please sign in to comment.