Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add test for adding attribute to package
- Loading branch information
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/api/spec/cassettes/Packages/attributes_subtab/add_attribute.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FactoryGirl.define do | ||
factory :attrib_namespace do | ||
name Faker::Lorem.word | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FactoryGirl.define do | ||
factory :attrib_type do | ||
sequence(:name) { |n| "attribute_factory_#{n}" } | ||
|
||
factory :attrib_type_with_namespace do | ||
attrib_namespace { create(:attrib_namespace) } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FactoryGirl.define do | ||
factory :package do | ||
name Faker::Lorem.word | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require "browser_helper" | ||
|
||
RSpec.feature "Attributes", :type => :feature, :js => true do | ||
let!(:user) { create(:confirmed_user) } | ||
|
||
describe "attributes subtab" do | ||
let!(:package) { | ||
create(:package, project_id: Project.find_by_name(user.home_project_name).id) | ||
} | ||
let!(:attribute) { create(:attrib_type_with_namespace) } | ||
|
||
scenario "add attribute" do | ||
login user | ||
|
||
visit index_attribs_path(project: user.home_project_name, package: package.name) | ||
click_link("add-new-attribute") | ||
expect(page).to have_text("Add Attribute") | ||
find("select#attrib_attrib_type_id").select(attribute.name) | ||
click_button "Create Attribute" | ||
expect(page).to have_content("Attribute was successfully created.") | ||
end | ||
end | ||
|
||
end |