Skip to content

Commit

Permalink
Complete 'listing providers' IT
Browse files Browse the repository at this point in the history
Fix `resource_type` for storage resource factories

The reason why no resources were displayed was because
no resources were attached to the provider. The more_attributes
field of provider had no effect.
  • Loading branch information
joe4dev committed Mar 20, 2016
1 parent 33c76b3 commit 696aefb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions test/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@
trait :amazon_s1 do
name 'storage'
more_attributes(JSON.parse '{"price_per_gb":"0.0300"}')
resource_type 'storage'
end
trait :amazon_s2 do
name 'infrequentAccessStorage'
more_attributes(JSON.parse '{"price_per_gb":"0.0125"}')
resource_type 'storage'
end

trait :google_c1 do
Expand All @@ -224,6 +226,7 @@
trait :google_s1 do
name 'CP-BIGSTORE-STORAGE'
more_attributes(JSON.parse '{"price_per_month_gb":0.026}')
resource_type 'storage'
end
end

Expand Down
11 changes: 8 additions & 3 deletions test/integration/provider_stories_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
class ProviderStoriesTest < ActionDispatch::IntegrationTest
test 'listing providers' do
amazon = create(:amazon_provider)
google = create(:google_provider)

visit providers_path
assert page.has_content? 'Amazon'
# TODO: The provider price list does not show up at all using PhantomJS or Selenium Javascript driver
# assert page.has_content? 't2.nano'
assert page.has_content? amazon.name
assert page.has_content? 't2.nano'
assert page.has_content? 't2.micro'
assert page.has_no_content?('storage'), 'Only show compute resources'

assert page.has_content? google.name
assert page.has_content? 'f1-micro'
end
end

0 comments on commit 696aefb

Please sign in to comment.