clean-up code

* Remove trailing whitespace
  * Converts hard-tabs into two-space soft-tabs
  * Remove consecutive blank lines
This commit is contained in:
Nihad Abbasov 2011-10-26 18:46:25 +05:00
parent f6a67fbad5
commit d62200cad4
112 changed files with 1408 additions and 1437 deletions

View file

@ -1,12 +1,12 @@
module LoginMacros
def login_as role
@user = User.create(:email => "user#{User.count}@mail.com",
@user = User.create(:email => "user#{User.count}@mail.com",
:name => "John Smith",
:password => "123456",
:password_confirmation => "123456",
:skype => 'user_skype')
if role == :admin
if role == :admin
@user.admin = true
@user.save!
end
@ -23,7 +23,7 @@ module LoginMacros
fill_in "Password", :with => "123456"
click_button "Sign in"
end
def logout
click_link "Logout" rescue nil
end

View file

@ -18,17 +18,17 @@ RSpec::Matchers.define :be_denied_for do |user|
match do |url|
include UrlAccess
url_denied?(user, url)
end
end
end
RSpec::Matchers.define :be_404_for do |user|
match do |url|
include UrlAccess
url_404?(user, url)
end
end
end
module UrlAccess
module UrlAccess
def url_allowed?(user, url)
emulate_user(user)
visit url

View file

@ -6,13 +6,12 @@ shared_examples_for :project_side_pane do
it { should have_content("Tree") }
end
shared_examples_for :tree_view do
subject { page }
it "should have Tree View of project" do
should have_content("app")
should have_content("history")
should have_content("Gemfile")
should have_content("app")
should have_content("history")
should have_content("Gemfile")
end
end