Fix specs
This commit is contained in:
parent
a85e11fa51
commit
578cf89812
6 changed files with 39 additions and 36 deletions
|
@ -5,24 +5,27 @@ describe "Issues" do
|
|||
|
||||
before do
|
||||
login_as :user
|
||||
@user2 = create(:user)
|
||||
user2 = create(:user)
|
||||
|
||||
project.add_access(@user, :read, :write)
|
||||
project.add_access(@user2, :read, :write)
|
||||
project.add_access(user2, :read, :write)
|
||||
end
|
||||
|
||||
describe "Edit issue", js: true do
|
||||
let!(:issue) do
|
||||
create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project)
|
||||
end
|
||||
|
||||
before do
|
||||
@issue = create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project)
|
||||
visit project_issues_path(project)
|
||||
click_link "Edit"
|
||||
end
|
||||
|
||||
it "should open new issue popup" do
|
||||
page.should have_content("Issue ##{@issue.id}")
|
||||
page.should have_content("Issue ##{issue.id}")
|
||||
end
|
||||
|
||||
describe "fill in" do
|
||||
|
@ -46,19 +49,18 @@ describe "Issues" do
|
|||
describe "Search issue", js: true do
|
||||
before do
|
||||
['foobar', 'foobar2', 'gitlab'].each do |title|
|
||||
@issue = create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project,
|
||||
title: title)
|
||||
@issue.save
|
||||
create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project,
|
||||
title: title)
|
||||
end
|
||||
end
|
||||
|
||||
it "should be able to search on different statuses" do
|
||||
@issue = Issue.first
|
||||
@issue.closed = true
|
||||
@issue.save
|
||||
issue = Issue.first # with title 'foobar'
|
||||
issue.closed = true
|
||||
issue.save
|
||||
|
||||
visit project_issues_path(project)
|
||||
click_link 'Closed'
|
||||
|
@ -81,8 +83,9 @@ describe "Issues" do
|
|||
it "should return all results if term has been cleared" do
|
||||
visit project_issues_path(project)
|
||||
fill_in "issue_search", with: "foobar"
|
||||
# Because fill_in, with: "" triggers nothing we need to trigger a keyup event
|
||||
page.execute_script("$('.issue_search').val('').keyup();");
|
||||
# Reset the search field and trigger loading the issues
|
||||
fill_in "issue_search", with: ""
|
||||
page.execute_script("$('#issue_search').keyup();");
|
||||
|
||||
page.should have_content 'foobar'
|
||||
page.should have_content 'foobar2'
|
||||
|
@ -93,19 +96,21 @@ describe "Issues" do
|
|||
describe "Filter issue" do
|
||||
before do
|
||||
['foobar', 'barbaz', 'gitlab'].each do |title|
|
||||
@issue = create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project,
|
||||
title: title)
|
||||
create(:issue,
|
||||
author: @user,
|
||||
assignee: @user,
|
||||
project: project,
|
||||
title: title)
|
||||
end
|
||||
|
||||
@issue = Issue.first
|
||||
@issue.milestone = create(:milestone, project: project)
|
||||
@issue.assignee = nil
|
||||
@issue.save
|
||||
issue = Issue.first # with title 'foobar'
|
||||
issue.milestone = create(:milestone, project: project)
|
||||
issue.assignee = nil
|
||||
issue.save
|
||||
end
|
||||
|
||||
let(:issue) { Issue.first }
|
||||
|
||||
it "should allow filtering by issues with no specified milestone" do
|
||||
visit project_issues_path(project, milestone_id: '0')
|
||||
|
||||
|
@ -115,7 +120,7 @@ describe "Issues" do
|
|||
end
|
||||
|
||||
it "should allow filtering by a specified milestone" do
|
||||
visit project_issues_path(project, milestone_id: @issue.milestone.id)
|
||||
visit project_issues_path(project, milestone_id: issue.milestone.id)
|
||||
|
||||
page.should have_content 'foobar'
|
||||
page.should_not have_content 'barbaz'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue