Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-02-12 21:17:35 +0300
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-02-12 21:17:35 +0300
commit0c4a70a306b871899bf87ce4673918abfee4d95f (patch)
treec7a702fb511209ffe0eceba245d1ffea71dce1aa /spec/features/admin
parentde1c450abd6b367390a1295cac402344f500d41d (diff)
Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'spec/features/admin')
-rw-r--r--spec/features/admin/admin_hooks_spec.rb10
-rw-r--r--spec/features/admin/admin_projects_spec.rb8
-rw-r--r--spec/features/admin/admin_users_spec.rb38
-rw-r--r--spec/features/admin/security_spec.rb18
4 files changed, 37 insertions, 37 deletions
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 37d6b416d22..25862614d28 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -15,12 +15,12 @@ describe "Admin::Hooks", feature: true do
within ".sidebar-wrapper" do
click_on "Hooks"
end
- current_path.should == admin_hooks_path
+ expect(current_path).to eq(admin_hooks_path)
end
it "should have hooks list" do
visit admin_hooks_path
- page.should have_content(@system_hook.url)
+ expect(page).to have_content(@system_hook.url)
end
end
@@ -33,8 +33,8 @@ describe "Admin::Hooks", feature: true do
end
it "should open new hook popup" do
- current_path.should == admin_hooks_path
- page.should have_content(@url)
+ expect(current_path).to eq(admin_hooks_path)
+ expect(page).to have_content(@url)
end
end
@@ -45,7 +45,7 @@ describe "Admin::Hooks", feature: true do
click_link "Test Hook"
end
- it { current_path.should == admin_hooks_path }
+ it { expect(current_path).to eq(admin_hooks_path) }
end
end
diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb
index 3b3d027ab75..eae3d102334 100644
--- a/spec/features/admin/admin_projects_spec.rb
+++ b/spec/features/admin/admin_projects_spec.rb
@@ -12,11 +12,11 @@ describe "Admin::Projects", feature: true do
end
it "should be ok" do
- current_path.should == admin_projects_path
+ expect(current_path).to eq(admin_projects_path)
end
it "should have projects list" do
- page.should have_content(@project.name)
+ expect(page).to have_content(@project.name)
end
end
@@ -27,8 +27,8 @@ describe "Admin::Projects", feature: true do
end
it "should have project info" do
- page.should have_content(@project.path)
- page.should have_content(@project.name)
+ expect(page).to have_content(@project.path)
+ expect(page).to have_content(@project.name)
end
end
end
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 59c4ffb5624..c6c9f1f33c1 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -9,12 +9,12 @@ describe "Admin::Users", feature: true do
end
it "should be ok" do
- current_path.should == admin_users_path
+ expect(current_path).to eq(admin_users_path)
end
it "should have users list" do
- page.should have_content(@user.email)
- page.should have_content(@user.name)
+ expect(page).to have_content(@user.email)
+ expect(page).to have_content(@user.name)
end
end
@@ -33,19 +33,19 @@ describe "Admin::Users", feature: true do
it "should apply defaults to user" do
click_button "Create user"
user = User.find_by(username: 'bang')
- user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit
- user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group
+ expect(user.projects_limit).to eq(Gitlab.config.gitlab.default_projects_limit)
+ expect(user.can_create_group).to eq(Gitlab.config.gitlab.default_can_create_group)
end
it "should create user with valid data" do
click_button "Create user"
user = User.find_by(username: 'bang')
- user.name.should == "Big Bang"
- user.email.should == "bigbang@mail.com"
+ expect(user.name).to eq("Big Bang")
+ expect(user.email).to eq("bigbang@mail.com")
end
it "should call send mail" do
- Notify.should_receive(:new_user_email)
+ expect(Notify).to receive(:new_user_email)
click_button "Create user"
end
@@ -54,9 +54,9 @@ describe "Admin::Users", feature: true do
click_button "Create user"
user = User.find_by(username: 'bang')
email = ActionMailer::Base.deliveries.last
- email.subject.should have_content("Account was created")
- email.text_part.body.should have_content(user.email)
- email.text_part.body.should have_content('password')
+ expect(email.subject).to have_content("Account was created")
+ expect(email.text_part.body).to have_content(user.email)
+ expect(email.text_part.body).to have_content('password')
end
end
@@ -67,8 +67,8 @@ describe "Admin::Users", feature: true do
end
it "should have user info" do
- page.should have_content(@user.email)
- page.should have_content(@user.name)
+ expect(page).to have_content(@user.email)
+ expect(page).to have_content(@user.name)
end
end
@@ -80,8 +80,8 @@ describe "Admin::Users", feature: true do
end
it "should have user edit page" do
- page.should have_content("Name")
- page.should have_content("Password")
+ expect(page).to have_content("Name")
+ expect(page).to have_content("Password")
end
describe "Update user" do
@@ -93,14 +93,14 @@ describe "Admin::Users", feature: true do
end
it "should show page with new data" do
- page.should have_content("bigbang@mail.com")
- page.should have_content("Big Bang")
+ expect(page).to have_content("bigbang@mail.com")
+ expect(page).to have_content("Big Bang")
end
it "should change user entry" do
@simple_user.reload
- @simple_user.name.should == "Big Bang"
- @simple_user.is_admin?.should be_true
+ expect(@simple_user.name).to eq("Big Bang")
+ expect(@simple_user.is_admin?).to be_truthy
end
end
end
diff --git a/spec/features/admin/security_spec.rb b/spec/features/admin/security_spec.rb
index 21b0d8b965e..2bcd3d8d010 100644
--- a/spec/features/admin/security_spec.rb
+++ b/spec/features/admin/security_spec.rb
@@ -4,24 +4,24 @@ describe "Admin::Projects", feature: true do
describe "GET /admin/projects" do
subject { admin_projects_path }
- it { should be_allowed_for :admin }
- it { should be_denied_for :user }
- it { should be_denied_for :visitor }
+ it { is_expected.to be_allowed_for :admin }
+ it { is_expected.to be_denied_for :user }
+ it { is_expected.to be_denied_for :visitor }
end
describe "GET /admin/users" do
subject { admin_users_path }
- it { should be_allowed_for :admin }
- it { should be_denied_for :user }
- it { should be_denied_for :visitor }
+ it { is_expected.to be_allowed_for :admin }
+ it { is_expected.to be_denied_for :user }
+ it { is_expected.to be_denied_for :visitor }
end
describe "GET /admin/hooks" do
subject { admin_hooks_path }
- it { should be_allowed_for :admin }
- it { should be_denied_for :user }
- it { should be_denied_for :visitor }
+ it { is_expected.to be_allowed_for :admin }
+ it { is_expected.to be_denied_for :user }
+ it { is_expected.to be_denied_for :visitor }
end
end