Commit 88aea500243c17b891bcf46eae466ddb6e0dab1a
1 parent
e17ea825
Exists in
master
and in
1 other branch
Add Acceptance test to unwatch application
Showing
4 changed files
with
28 additions
and
1 deletions
Show diff stats
app/views/devise/sessions/new.html.haml
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | = f.label :remember_me | 22 | = f.label :remember_me |
| 23 | 23 | ||
| 24 | %div.buttons | 24 | %div.buttons |
| 25 | - %button{:type => 'submit', :class => 'sign_in'}= "Sign in" | 25 | + %button{:type => 'submit', :class => 'sign_in'}=t('.sign_in') |
| 26 | 26 | ||
| 27 | :javascript | 27 | :javascript |
| 28 | $('a#forgot_password').click(function(){ | 28 | $('a#forgot_password').click(function(){ |
config/locales/en.yml
| @@ -65,6 +65,9 @@ en: | @@ -65,6 +65,9 @@ en: | ||
| 65 | omniauth_callbacks: | 65 | omniauth_callbacks: |
| 66 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." | 66 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"." |
| 67 | success: "Successfully authenticated from %{kind} account." | 67 | success: "Successfully authenticated from %{kind} account." |
| 68 | + sessions: | ||
| 69 | + new: | ||
| 70 | + sign_in: "Sign in" | ||
| 68 | 71 | ||
| 69 | apps: | 72 | apps: |
| 70 | index: | 73 | index: |
spec/acceptance/sign_in_with_github_spec.rb
| 1 | require 'acceptance/acceptance_helper' | 1 | require 'acceptance/acceptance_helper' |
| 2 | 2 | ||
| 3 | feature 'Sign in with GitHub' do | 3 | feature 'Sign in with GitHub' do |
| 4 | + | ||
| 4 | background do | 5 | background do |
| 5 | Errbit::Config.stub(:github_authentication) { true } | 6 | Errbit::Config.stub(:github_authentication) { true } |
| 6 | Fabricate(:user, :github_login => 'nashby') | 7 | Fabricate(:user, :github_login => 'nashby') |
| @@ -0,0 +1,23 @@ | @@ -0,0 +1,23 @@ | ||
| 1 | +require 'acceptance/acceptance_helper' | ||
| 2 | + | ||
| 3 | +feature 'A user can watch and unwatch an application' do | ||
| 4 | + | ||
| 5 | + let!(:app) { Fabricate(:app) } | ||
| 6 | + let!(:user) do | ||
| 7 | + user = Fabricate(:user) | ||
| 8 | + app.watchers.create!( | ||
| 9 | + :user_id => user.id | ||
| 10 | + ) | ||
| 11 | + user.reload | ||
| 12 | + end | ||
| 13 | + | ||
| 14 | + scenario 'log in watch a project and unwatch it' do | ||
| 15 | + visit '/' | ||
| 16 | + fill_in :user_email, :with => user.email | ||
| 17 | + fill_in :user_password, :with => 'password' | ||
| 18 | + click_on I18n.t('devise.sessions.new.sign_in') | ||
| 19 | + click_on I18n.t('apps.show.unwatch') | ||
| 20 | + expect(page).to have_content(I18n.t('apps.index.no_apps') | ||
| 21 | + end | ||
| 22 | + | ||
| 23 | +end |