Skip to content

Commit

Permalink
Add Acceptance test to unwatch application
Browse files Browse the repository at this point in the history
  • Loading branch information
shingara committed Sep 17, 2013
1 parent e17ea82 commit 88aea50
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.haml
Expand Up @@ -22,7 +22,7 @@
= f.label :remember_me

%div.buttons
%button{:type => 'submit', :class => 'sign_in'}= "Sign in"
%button{:type => 'submit', :class => 'sign_in'}=t('.sign_in')

:javascript
$('a#forgot_password').click(function(){
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Expand Up @@ -65,6 +65,9 @@ en:
omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account."
sessions:
new:
sign_in: "Sign in"

apps:
index:
Expand Down
1 change: 1 addition & 0 deletions spec/acceptance/sign_in_with_github_spec.rb
@@ -1,6 +1,7 @@
require 'acceptance/acceptance_helper'

feature 'Sign in with GitHub' do

background do
Errbit::Config.stub(:github_authentication) { true }
Fabricate(:user, :github_login => 'nashby')
Expand Down
23 changes: 23 additions & 0 deletions spec/acceptance/watch_unwatch_app.rb
@@ -0,0 +1,23 @@
require 'acceptance/acceptance_helper'

feature 'A user can watch and unwatch an application' do

let!(:app) { Fabricate(:app) }
let!(:user) do
user = Fabricate(:user)
app.watchers.create!(
:user_id => user.id
)
user.reload
end

scenario 'log in watch a project and unwatch it' do
visit '/'
fill_in :user_email, :with => user.email
fill_in :user_password, :with => 'password'
click_on I18n.t('devise.sessions.new.sign_in')
click_on I18n.t('apps.show.unwatch')
expect(page).to have_content(I18n.t('apps.index.no_apps')
end

end

0 comments on commit 88aea50

Please sign in to comment.